38 ATLASSERT(lDays >= 0 && nHours >= 0 && nHours <= 23 && nMins >= 0 && nMins <= 59 && nSecs >= 0 && nSecs <= 59);
39 m_nSpan = ((((
LONGLONG)lDays) * 24 + nHours) * 60 + nMins) * 60 + nSecs;
143 CTime(
int nYear,
int nMonth,
int nDay,
int nHour,
int nMin,
int nSec,
int nDST = -1)
146 time.tm_year = nYear;
147 time.tm_mon = nMonth;
149 time.tm_hour = nHour;
152 time.tm_isdst = nDST;
169 time.tm_isdst = nDST;
182 time.tm_isdst = nDST;
197 time.tm_isdst = nDST;
209 time.tm_isdst = nDST;
277 dbts.year =
time.tm_year;
278 dbts.month =
time.tm_mon;
279 dbts.day =
time.tm_mday;
280 dbts.hour =
time.tm_hour;
281 dbts.minute =
time.tm_min;
282 dbts.second =
time.tm_sec;
291 st.wYear =
time.tm_year;
292 st.wMonth =
time.tm_mon;
293 st.wDayOfWeek =
time.tm_wday;
294 st.wDay =
time.tm_mday;
295 st.wHour =
time.tm_hour;
296 st.wMinute =
time.tm_min;
297 st.wSecond =
time.tm_sec;
298 st.wMilliseconds = 0;
606 return this->
GetTime() != ft.GetTime();
622 return this->
GetTime() < ft.GetTime();
627 return this->
GetTime() <= ft.GetTime();
645 return this->
GetTime() == ft.GetTime();
650 return this->
GetTime() > ft.GetTime();
655 return this->
GetTime() >= ft.GetTime();
CFileTime(const FILETIME &ft)
static CFileTime GetCurrentTime()
static const ULONGLONG Millisecond
__time64_t GetTime() const
CTime(const FILETIME &ft, int nDST=-1)
ULONGLONG GetTime() const
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
bool operator!=(CTime time) const
static CTime WINAPI GetCurrentTime()
bool GetAsDBTIMESTAMP(DBTIMESTAMP &dbts) const
void SetTime(ULONGLONG nTime)
CFileTime & operator-=(CFileTimeSpan span)
CFileTime operator-(CFileTimeSpan span) const
CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs)
CString FormatGmt(LPCTSTR pszFormat) const
CFileTime UTCToLocal() const
CFileTimeSpan operator+(CFileTimeSpan span) const
_CRTIMP errno_t __cdecl _localtime64_s(_Out_ struct tm *_Tm, _In_ const __time64_t *_Time)
CTime & operator=(__time64_t time)
bool operator<(CFileTime ft) const
bool operator>=(CFileTime ft) const
CFileTime(ULONGLONG nTime)
size_t CDECL wcsftime(wchar_t *str, size_t max, const wchar_t *format, const struct tm *mstm)
static const ULONGLONG Day
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
_CRTIMP __time64_t __cdecl _time64(_Out_opt_ __time64_t *_Time)
CTime & operator-=(CTimeSpan span)
CTime & operator+=(CTimeSpan span)
bool operator<=(CFileTimeSpan span) const
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
void ReleaseBuffer(_In_ int nNewLength=-1)
CString Format(UINT nFormatID) const
bool operator<=(CFileTime ft) const
bool operator>(CTime time) const
static const ULONGLONG Second
LONGLONG GetTotalMinutes() const
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
void SetTimeSpan(LONGLONG nSpan)
CTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST=-1)
CFileTimeSpan(const CFileTimeSpan &span)
CTimeSpan operator-(CTime time) const
CFileTimeSpan operator-(CFileTime ft) const
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
bool operator<=(CTime time) const
bool operator==(CTime time) const
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
CFileTimeSpan operator-(CFileTimeSpan span) const
CString FormatGmt(UINT nFormatID) const
CFileTime LocalToUTC() const
CString Format(UINT nID) const
CTimeSpan(__time64_t time)
static const ULONGLONG Minute
static const ULONGLONG Hour
CFileTime & operator=(const FILETIME &ft)
CTime operator+(CTimeSpan timeSpan) const
CTime(WORD wDosDate, WORD wDosTime, int nDST=-1)
CFileTime operator+(CFileTimeSpan span) const
CFileTime & operator+=(CFileTimeSpan span)
CFileTimeSpan & operator=(const CFileTimeSpan &span)
bool operator!=(CFileTime ft) const
CString Format(LPCTSTR pszFormat) const
CString Format(LPCSTR pFormat) const
bool operator<(CTime time) const
CFileTimeSpan & operator-=(CFileTimeSpan span)
__time64_t GetTimeSpan() const
bool GetAsSystemTime(SYSTEMTIME &st) const
LONGLONG GetTimeSpan() const
bool operator!=(CFileTimeSpan span) const
CTime(const SYSTEMTIME &st, int nDST=-1)
LONGLONG GetTotalSeconds() const
bool operator==(CFileTime ft) const
_CRTIMP __time64_t __cdecl _mktime64(_Inout_ struct tm *_Tm)
struct tm * GetGmtTm(struct tm *ptm) const
bool operator>(CFileTimeSpan span) const
BOOL LoadString(_In_ UINT nID)
CString Format(LPCTSTR pszFormat) const
GLenum GLenum GLvoid GLvoid GLvoid * span
CFileTimeSpan & operator+=(CFileTimeSpan span)
CTime operator-(CTimeSpan timeSpan) const
static const ULONGLONG Week
CTime(const DBTIMESTAMP &dbts, int nDST=-1)
struct tm * GetLocalTm(struct tm *ptm) const
_CRTIMP errno_t __cdecl _gmtime64_s(_Out_ struct tm *_Tm, _In_ const __time64_t *_Time)
CFileTimeSpan(LONGLONG nSpan)
bool operator>(CFileTime ft) const
bool operator<(CFileTimeSpan span) const
LONGLONG GetTotalHours() const
bool operator>=(CFileTimeSpan span) const
bool operator>=(CTime time) const
__MINGW_EXTENSION typedef __int64 __time64_t
bool operator==(CFileTimeSpan span) const