ReactOS  0.4.13-dev-100-gc8611ae
atltime.h
Go to the documentation of this file.
1 // PROJECT: ReactOS ATL CTime, CFileTime, CTimeSpan, CFileTimeSpan
2 // LICENSE: Public Domain
3 // PURPOSE: Provides compatibility to Microsoft ATL
4 // PROGRAMMERS: Benedikt Freisen
5 
6 #ifndef __ATLTIME_H__
7 #define __ATLTIME_H__
8 
9 // WARNING: Untested code
10 
11 #pragma once
12 
13 #include <atlcore.h>
14 #include <windows.h>
15 #include <atlstr.h>
16 #include <time.h>
17 #include <oledb.h>
18 
19 namespace ATL
20 {
21 
22 class CTimeSpan
23 {
25 public:
26  CTimeSpan() throw()
27  {
28  // leave uninitialized
29  }
30 
32  {
33  m_nSpan = time;
34  }
35 
36  CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs) throw()
37  {
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;
40  }
41 
42  CString Format(LPCSTR pFormat) const
43  {
44  struct tm time;
46  CStringA strTime;
47  strftime(strTime.GetBuffer(256), 256, pFormat, &time);
48  strTime.ReleaseBuffer();
49  return CString(strTime);
50  }
51 
52  CString Format(LPCTSTR pszFormat) const
53  {
54  struct tm time;
56  CString strTime;
57 #ifdef UNICODE
58  wcsftime(strTime.GetBuffer(256), 256, pszFormat, &time);
59 #else
60  strftime(strTime.GetBuffer(256), 256, pszFormat, &time);
61 #endif
62  strTime.ReleaseBuffer();
63  return strTime;
64  }
65 
66  CString Format(UINT nID) const
67  {
68  struct tm time;
70  CString strFormat;
71  strFormat.LoadString(nID);
72  CString strTime;
73 #ifdef UNICODE
74  wcsftime(strTime.GetBuffer(256), 256, strFormat, &time);
75 #else
76  strftime(strTime.GetBuffer(256), 256, strFormat, &time);
77 #endif
78  strTime.ReleaseBuffer();
79  return strTime;
80  }
81 
82  LONGLONG GetTotalHours() const throw()
83  {
84  return m_nSpan / 60 / 60;
85  }
86 
87  LONGLONG GetTotalMinutes() const throw()
88  {
89  return m_nSpan / 60;
90  }
91 
92  LONGLONG GetTotalSeconds() const throw()
93  {
94  return m_nSpan;
95  }
96 
97  LONGLONG GetDays() const throw()
98  {
99  return m_nSpan / 60 / 60 / 24;
100  }
101 
102  LONG GetHours() const throw()
103  {
104  return GetTotalHours() - GetDays() * 24;
105  }
106 
107  LONG GetMinutes() const throw()
108  {
109  return GetTotalMinutes() - GetTotalHours() * 60;
110  }
111 
112  LONG GetSeconds() const throw()
113  {
114  return GetTotalSeconds() - GetTotalMinutes() * 60;
115  }
116 
117  __time64_t GetTimeSpan() const throw()
118  {
119  return m_nSpan;
120  }
121 
122 // CArchive& Serialize64(CArchive& ar) // MFC only
123 // {
124 // // TODO
125 // }
126 
127 };
128 
129 class CTime
130 {
132 public:
133  CTime() throw()
134  {
135  // leave uninitialized
136  }
137 
139  {
140  m_nTime = time;
141  }
142 
143  CTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1)
144  {
145  struct tm time;
146  time.tm_year = nYear;
147  time.tm_mon = nMonth;
148  time.tm_mday = nDay;
149  time.tm_hour = nHour;
150  time.tm_min = nMin;
151  time.tm_sec = nSec;
152  time.tm_isdst = nDST;
153  m_nTime = _mktime64(&time);
154  }
155 
156  CTime(WORD wDosDate, WORD wDosTime, int nDST = -1)
157  {
158  FILETIME ft;
159  DosDateTimeToFileTime(wDosDate, wDosTime, &ft);
160  SYSTEMTIME st;
161  FileTimeToSystemTime(&ft, &st);
162  struct tm time;
163  time.tm_year = st.wYear;
164  time.tm_mon = st.wMonth;
165  time.tm_wday = st.wDayOfWeek;
166  time.tm_hour = st.wHour;
167  time.tm_min = st.wMinute;
168  time.tm_sec = st.wSecond;
169  time.tm_isdst = nDST;
170  m_nTime = _mktime64(&time);
171  }
172 
173  CTime(const SYSTEMTIME& st, int nDST = -1) throw()
174  {
175  struct tm time;
176  time.tm_year = st.wYear;
177  time.tm_mon = st.wMonth;
178  time.tm_wday = st.wDayOfWeek;
179  time.tm_hour = st.wHour;
180  time.tm_min = st.wMinute;
181  time.tm_sec = st.wSecond;
182  time.tm_isdst = nDST;
183  m_nTime = _mktime64(&time);
184  }
185 
186  CTime(const FILETIME& ft, int nDST = -1)
187  {
188  SYSTEMTIME st;
189  FileTimeToSystemTime(&ft, &st);
190  struct tm time;
191  time.tm_year = st.wYear;
192  time.tm_mon = st.wMonth;
193  time.tm_wday = st.wDayOfWeek;
194  time.tm_hour = st.wHour;
195  time.tm_min = st.wMinute;
196  time.tm_sec = st.wSecond;
197  time.tm_isdst = nDST;
198  m_nTime = _mktime64(&time);
199  }
200 
201  CTime(const DBTIMESTAMP& dbts, int nDST = -1) throw()
202  {
203  struct tm time;
204  time.tm_year = dbts.year;
205  time.tm_mon = dbts.month;
206  time.tm_hour = dbts.hour;
207  time.tm_min = dbts.minute;
208  time.tm_sec = dbts.second;
209  time.tm_isdst = nDST;
210  m_nTime = _mktime64(&time);
211  }
212 
213  CString Format(LPCTSTR pszFormat) const
214  {
215  struct tm time;
217  CString strTime;
218 #ifdef UNICODE
219  wcsftime(strTime.GetBuffer(256), 256, pszFormat, &time);
220 #else
221  strftime(strTime.GetBuffer(256), 256, pszFormat, &time);
222 #endif
223  strTime.ReleaseBuffer();
224  return strTime;
225  }
226 
227  CString Format(UINT nFormatID) const
228  {
229  struct tm time;
231  CString strFormat;
232  strFormat.LoadString(nFormatID);
233  CString strTime;
234 #ifdef UNICODE
235  wcsftime(strTime.GetBuffer(256), 256, strFormat, &time);
236 #else
237  strftime(strTime.GetBuffer(256), 256, strFormat, &time);
238 #endif
239  strTime.ReleaseBuffer();
240  return strTime;
241  }
242 
243  CString FormatGmt(LPCTSTR pszFormat) const
244  {
245  struct tm time;
247  CString strTime;
248 #ifdef UNICODE
249  wcsftime(strTime.GetBuffer(256), 256, pszFormat, &time);
250 #else
251  strftime(strTime.GetBuffer(256), 256, pszFormat, &time);
252 #endif
253  strTime.ReleaseBuffer();
254  return strTime;
255  }
256 
257  CString FormatGmt(UINT nFormatID) const
258  {
259  struct tm time;
261  CString strFormat;
262  strFormat.LoadString(nFormatID);
263  CString strTime;
264 #ifdef UNICODE
265  wcsftime(strTime.GetBuffer(256), 256, strFormat, &time);
266 #else
267  strftime(strTime.GetBuffer(256), 256, strFormat, &time);
268 #endif
269  strTime.ReleaseBuffer();
270  return strTime;
271  }
272 
273  bool GetAsDBTIMESTAMP(DBTIMESTAMP& dbts) const throw()
274  {
275  struct tm time;
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;
283  dbts.fraction = 0;
284  return true; // TODO: error handling?
285  }
286 
287  bool GetAsSystemTime(SYSTEMTIME& st) const throw()
288  {
289  struct tm time;
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;
299  return true; // TODO: error handling?
300  }
301 
302  static CTime WINAPI GetCurrentTime() throw()
303  {
305  _time64(&time);
306  return CTime(time);
307  }
308 
309  int GetDay() const throw()
310  {
311  struct tm time;
313  return time.tm_mday;
314  }
315 
316  int GetDayOfWeek() const throw()
317  {
318  struct tm time;
320  return time.tm_wday;
321  }
322 
323  struct tm* GetGmtTm(struct tm* ptm) const
324  {
325  _gmtime64_s(ptm, &m_nTime);
326  return ptm;
327  }
328 
329  int GetHour() const throw()
330  {
331  struct tm time;
333  return time.tm_hour;
334  }
335 
336  struct tm* GetLocalTm(struct tm* ptm) const
337  {
338  _localtime64_s(ptm, &m_nTime);
339  return ptm;
340  }
341 
342  int GetMinute() const throw()
343  {
344  struct tm time;
346  return time.tm_min;
347  }
348 
349  int GetMonth() const throw()
350  {
351  struct tm time;
353  return time.tm_mon;
354  }
355 
356  int GetSecond() const throw()
357  {
358  struct tm time;
360  return time.tm_sec;
361  }
362 
363  __time64_t GetTime() const throw()
364  {
365  return m_nTime;
366  }
367 
368  int GetYear()
369  {
370  struct tm time;
372  return time.tm_year;
373  }
374 
375 // CArchive& Serialize64(CArchive& ar) // MFC only
376 // {
377 // // TODO
378 // }
379 
380  CTime operator+(CTimeSpan timeSpan) const throw()
381  {
382  return CTime(m_nTime + timeSpan.GetTimeSpan());
383  }
384 
385  CTime operator-(CTimeSpan timeSpan) const throw()
386  {
387  return CTime(m_nTime - timeSpan.GetTimeSpan());
388  }
389 
390  CTimeSpan operator-(CTime time) const throw()
391  {
392  return CTimeSpan(m_nTime - time.GetTime());
393  }
394 
396  {
397  m_nTime += span.GetTimeSpan();
398  return *this;
399  }
400 
402  {
403  m_nTime -= span.GetTimeSpan();
404  return *this;
405  }
406 
408  {
409  m_nTime = time;
410  return *this;
411  }
412 
413  bool operator==(CTime time) const throw()
414  {
415  return m_nTime == time.GetTime();
416  }
417 
418  bool operator!=(CTime time) const throw()
419  {
420  return m_nTime != time.GetTime();
421  }
422 
423  bool operator<(CTime time) const throw()
424  {
425  return m_nTime < time.GetTime();
426  }
427 
428  bool operator>(CTime time) const throw()
429  {
430  return m_nTime > time.GetTime();
431  }
432 
433  bool operator<=(CTime time) const throw()
434  {
435  return m_nTime <= time.GetTime();
436  }
437 
438  bool operator>=(CTime time) const throw()
439  {
440  return m_nTime >= time.GetTime();
441  }
442 
443 };
444 
446 {
448 public:
449  CFileTimeSpan() throw()
450  {
451  m_nSpan = 0;
452  }
453 
455  {
456  m_nSpan = span.GetTimeSpan();
457  }
458 
459  CFileTimeSpan(LONGLONG nSpan) throw()
460  {
461  m_nSpan = nSpan;
462  }
463 
464  LONGLONG GetTimeSpan() const throw()
465  {
466  return m_nSpan;
467  }
468 
469  void SetTimeSpan(LONGLONG nSpan) throw()
470  {
471  m_nSpan = nSpan;
472  }
473 
475  {
476  return CFileTimeSpan(m_nSpan - span.GetTimeSpan());
477  }
478 
479  bool operator!=(CFileTimeSpan span) const throw()
480  {
481  return m_nSpan != span.GetTimeSpan();
482  }
483 
485  {
486  return CFileTimeSpan(m_nSpan + span.GetTimeSpan());
487  }
488 
490  {
491  m_nSpan += span.GetTimeSpan();
492  return *this;
493  }
494 
495  bool operator<(CFileTimeSpan span) const throw()
496  {
497  return m_nSpan < span.GetTimeSpan();
498  }
499 
500  bool operator<=(CFileTimeSpan span) const throw()
501  {
502  return m_nSpan <= span.GetTimeSpan();
503  }
504 
506  {
507  m_nSpan = span.GetTimeSpan();
508  return *this;
509  }
510 
512  {
513  m_nSpan -= span.GetTimeSpan();
514  return *this;
515  }
516 
517  bool operator==(CFileTimeSpan span) const throw()
518  {
519  return m_nSpan == span.GetTimeSpan();
520  }
521 
522  bool operator>(CFileTimeSpan span) const throw()
523  {
524  return m_nSpan > span.GetTimeSpan();
525  }
526 
527  bool operator>=(CFileTimeSpan span) const throw()
528  {
529  return m_nSpan >= span.GetTimeSpan();
530  }
531 
532 };
533 
534 class CFileTime : public FILETIME
535 {
536 public:
537  static const ULONGLONG Millisecond = 10000;
538  static const ULONGLONG Second = Millisecond * 1000;
539  static const ULONGLONG Minute = Second * 60;
540  static const ULONGLONG Hour = Minute * 60;
541  static const ULONGLONG Day = Hour * 24;
542  static const ULONGLONG Week = Day * 7;
543 
544  CFileTime() throw()
545  {
546  this->dwLowDateTime = 0;
547  this->dwHighDateTime = 0;
548  }
549 
550  CFileTime(const FILETIME& ft) throw()
551  {
552  this->dwLowDateTime = ft.dwLowDateTime;
553  this->dwHighDateTime = ft.dwHighDateTime;
554  }
555 
556  CFileTime(ULONGLONG nTime) throw()
557  {
558  this->dwLowDateTime = (DWORD) nTime;
559  this->dwHighDateTime = nTime >> 32;
560  }
561 
562  static CFileTime GetCurrentTime() throw()
563  {
564  FILETIME ft;
566  return CFileTime(ft);
567  }
568 
569  ULONGLONG GetTime() const throw()
570  {
571  return ((ULONGLONG)this->dwLowDateTime) | (((ULONGLONG)this->dwHighDateTime) << 32);
572  }
573 
574  CFileTime LocalToUTC() const throw()
575  {
576  FILETIME ft;
577  LocalFileTimeToFileTime(this, &ft);
578  return CFileTime(ft);
579  }
580 
581  void SetTime(ULONGLONG nTime) throw()
582  {
583  this->dwLowDateTime = (DWORD) nTime;
584  this->dwHighDateTime = nTime >> 32;
585  }
586 
587  CFileTime UTCToLocal() const throw()
588  {
589  FILETIME ft;
590  FileTimeToLocalFileTime(this, &ft);
591  return CFileTime(ft);
592  }
593 
595  {
596  return CFileTime(this->GetTime() - span.GetTimeSpan());
597  }
598 
600  {
601  return CFileTimeSpan(this->GetTime() - ft.GetTime());
602  }
603 
604  bool operator!=(CFileTime ft) const throw()
605  {
606  return this->GetTime() != ft.GetTime();
607  }
608 
610  {
611  return CFileTime(this->GetTime() + span.GetTimeSpan());
612  }
613 
615  {
616  this->SetTime(this->GetTime() + span.GetTimeSpan());
617  return *this;
618  }
619 
620  bool operator<(CFileTime ft) const throw()
621  {
622  return this->GetTime() < ft.GetTime();
623  }
624 
625  bool operator<=(CFileTime ft) const throw()
626  {
627  return this->GetTime() <= ft.GetTime();
628  }
629 
630  CFileTime& operator=(const FILETIME& ft) throw()
631  {
632  this->dwLowDateTime = ft.dwLowDateTime;
633  this->dwHighDateTime = ft.dwHighDateTime;
634  return *this;
635  }
636 
638  {
639  this->SetTime(this->GetTime() - span.GetTimeSpan());
640  return *this;
641  }
642 
643  bool operator==(CFileTime ft) const throw()
644  {
645  return this->GetTime() == ft.GetTime();
646  }
647 
648  bool operator>(CFileTime ft) const throw()
649  {
650  return this->GetTime() > ft.GetTime();
651  }
652 
653  bool operator>=(CFileTime ft) const throw()
654  {
655  return this->GetTime() >= ft.GetTime();
656  }
657 
658 };
659 
660 } // namespace ATL
661 
662 #endif
CFileTime(const FILETIME &ft)
Definition: atltime.h:550
static CFileTime GetCurrentTime()
Definition: atltime.h:562
static const ULONGLONG Millisecond
Definition: atltime.h:537
__time64_t GetTime() const
Definition: atltime.h:363
CTime(const FILETIME &ft, int nDST=-1)
Definition: atltime.h:186
ULONGLONG GetTime() const
Definition: atltime.h:569
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
bool operator!=(CTime time) const
Definition: atltime.h:418
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
static CTime WINAPI GetCurrentTime()
Definition: atltime.h:302
int GetSecond() const
Definition: atltime.h:356
bool GetAsDBTIMESTAMP(DBTIMESTAMP &dbts) const
Definition: atltime.h:273
void SetTime(ULONGLONG nTime)
Definition: atltime.h:581
USHORT month
Definition: oledb.idl:45
CFileTime & operator-=(CFileTimeSpan span)
Definition: atltime.h:637
CFileTime operator-(CFileTimeSpan span) const
Definition: atltime.h:594
CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs)
Definition: atltime.h:36
WORD wMonth
Definition: winbase.h:871
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
WORD wDayOfWeek
Definition: winbase.h:872
CString FormatGmt(LPCTSTR pszFormat) const
Definition: atltime.h:243
CFileTime UTCToLocal() const
Definition: atltime.h:587
CFileTimeSpan operator+(CFileTimeSpan span) const
Definition: atltime.h:484
_CRTIMP errno_t __cdecl _localtime64_s(_Out_ struct tm *_Tm, _In_ const __time64_t *_Time)
CTime & operator=(__time64_t time)
Definition: atltime.h:407
bool operator<(CFileTime ft) const
Definition: atltime.h:620
bool operator>=(CFileTime ft) const
Definition: atltime.h:653
__u16 time
Definition: mkdosfs.c:366
CFileTime(ULONGLONG nTime)
Definition: atltime.h:556
size_t CDECL wcsftime(wchar_t *str, size_t max, const wchar_t *format, const struct tm *mstm)
Definition: strftime.c:302
static const ULONGLONG Day
Definition: atltime.h:541
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:211
#define DWORD
Definition: nt_native.h:44
_CRTIMP __time64_t __cdecl _time64(_Out_opt_ __time64_t *_Time)
LONGLONG m_nSpan
Definition: atltime.h:447
CTime & operator-=(CTimeSpan span)
Definition: atltime.h:401
CTime & operator+=(CTimeSpan span)
Definition: atltime.h:395
bool operator<=(CFileTimeSpan span) const
Definition: atltime.h:500
int GetMinute() const
Definition: atltime.h:342
BOOL WINAPI LocalFileTimeToFileTime(IN CONST FILETIME *lpLocalFileTime, OUT LPFILETIME lpFileTime)
Definition: time.c:243
DWORD dwHighDateTime
Definition: mapidefs.h:66
WORD wYear
Definition: winbase.h:870
USHORT minute
Definition: oledb.idl:48
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
long LONG
Definition: pedump.c:60
WORD wMinute
Definition: winbase.h:875
CString Format(UINT nFormatID) const
Definition: atltime.h:227
bool operator<=(CFileTime ft) const
Definition: atltime.h:625
const char * LPCSTR
Definition: xmlstorage.h:183
bool operator>(CTime time) const
Definition: atltime.h:428
static const ULONGLONG Second
Definition: atltime.h:538
LONGLONG GetTotalMinutes() const
Definition: atltime.h:87
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
Definition: strftime.c:293
void SetTimeSpan(LONGLONG nSpan)
Definition: atltime.h:469
CTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST=-1)
Definition: atltime.h:143
int64_t LONGLONG
Definition: typedefs.h:66
CFileTimeSpan(const CFileTimeSpan &span)
Definition: atltime.h:454
CTimeSpan operator-(CTime time) const
Definition: atltime.h:390
Definition: rosdlgs.h:5
CStringA CString
Definition: atlstr.h:139
CFileTimeSpan operator-(CFileTime ft) const
Definition: atltime.h:599
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:178
int GetYear()
Definition: atltime.h:368
bool operator<=(CTime time) const
Definition: atltime.h:433
bool operator==(CTime time) const
Definition: atltime.h:413
BOOL WINAPI DosDateTimeToFileTime(IN WORD wFatDate, IN WORD wFatTime, OUT LPFILETIME lpFileTime)
Definition: time.c:75
CFileTimeSpan operator-(CFileTimeSpan span) const
Definition: atltime.h:474
uint64_t ULONGLONG
Definition: typedefs.h:65
CString FormatGmt(UINT nFormatID) const
Definition: atltime.h:257
CFileTime LocalToUTC() const
Definition: atltime.h:574
#define WINAPI
Definition: msvc.h:8
unsigned short WORD
Definition: ntddk_ex.h:93
CString Format(UINT nID) const
Definition: atltime.h:66
CTimeSpan(__time64_t time)
Definition: atltime.h:31
static const ULONGLONG Minute
Definition: atltime.h:539
static const ULONGLONG Hour
Definition: atltime.h:540
CFileTime & operator=(const FILETIME &ft)
Definition: atltime.h:630
WORD wSecond
Definition: winbase.h:876
CTime operator+(CTimeSpan timeSpan) const
Definition: atltime.h:380
LONGLONG GetDays() const
Definition: atltime.h:97
CTime(WORD wDosDate, WORD wDosTime, int nDST=-1)
Definition: atltime.h:156
__time64_t m_nSpan
Definition: atltime.h:24
CFileTime operator+(CFileTimeSpan span) const
Definition: atltime.h:609
__time64_t m_nTime
Definition: atltime.h:131
USHORT second
Definition: oledb.idl:49
CFileTime & operator+=(CFileTimeSpan span)
Definition: atltime.h:614
CFileTimeSpan & operator=(const CFileTimeSpan &span)
Definition: atltime.h:505
LONG GetHours() const
Definition: atltime.h:102
bool operator!=(CFileTime ft) const
Definition: atltime.h:604
CString Format(LPCTSTR pszFormat) const
Definition: atltime.h:52
CString Format(LPCSTR pFormat) const
Definition: atltime.h:42
bool operator<(CTime time) const
Definition: atltime.h:423
Definition: time.h:76
LONG GetSeconds() const
Definition: atltime.h:112
int GetDay() const
Definition: atltime.h:309
CFileTimeSpan & operator-=(CFileTimeSpan span)
Definition: atltime.h:511
__time64_t GetTimeSpan() const
Definition: atltime.h:117
int GetDayOfWeek() const
Definition: atltime.h:316
bool GetAsSystemTime(SYSTEMTIME &st) const
Definition: atltime.h:287
LONGLONG GetTimeSpan() const
Definition: atltime.h:464
int GetHour() const
Definition: atltime.h:329
bool operator!=(CFileTimeSpan span) const
Definition: atltime.h:479
CTime(const SYSTEMTIME &st, int nDST=-1)
Definition: atltime.h:173
LONGLONG GetTotalSeconds() const
Definition: atltime.h:92
WORD wHour
Definition: winbase.h:874
bool operator==(CFileTime ft) const
Definition: atltime.h:643
SHORT year
Definition: oledb.idl:44
unsigned int UINT
Definition: ndis.h:50
USHORT hour
Definition: oledb.idl:47
LONG GetMinutes() const
Definition: atltime.h:107
_CRTIMP __time64_t __cdecl _mktime64(_Inout_ struct tm *_Tm)
struct tm * GetGmtTm(struct tm *ptm) const
Definition: atltime.h:323
bool operator>(CFileTimeSpan span) const
Definition: atltime.h:522
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
CString Format(LPCTSTR pszFormat) const
Definition: atltime.h:213
GLenum GLenum GLvoid GLvoid GLvoid * span
Definition: glext.h:5664
CFileTimeSpan & operator+=(CFileTimeSpan span)
Definition: atltime.h:489
CTime operator-(CTimeSpan timeSpan) const
Definition: atltime.h:385
static const ULONGLONG Week
Definition: atltime.h:542
CTime(const DBTIMESTAMP &dbts, int nDST=-1)
Definition: atltime.h:201
int GetMonth() const
Definition: atltime.h:349
struct tm * GetLocalTm(struct tm *ptm) const
Definition: atltime.h:336
_CRTIMP errno_t __cdecl _gmtime64_s(_Out_ struct tm *_Tm, _In_ const __time64_t *_Time)
CFileTimeSpan(LONGLONG nSpan)
Definition: atltime.h:459
bool operator>(CFileTime ft) const
Definition: atltime.h:648
bool operator<(CFileTimeSpan span) const
Definition: atltime.h:495
LONGLONG GetTotalHours() const
Definition: atltime.h:82
DWORD dwLowDateTime
Definition: mapidefs.h:65
bool operator>=(CFileTimeSpan span) const
Definition: atltime.h:527
bool operator>=(CTime time) const
Definition: atltime.h:438
__MINGW_EXTENSION typedef __int64 __time64_t
Definition: crtdefs.h:364
bool operator==(CFileTimeSpan span) const
Definition: atltime.h:517
CTime(__time64_t time)
Definition: atltime.h:138