Options available in representing date and time values:
(Links are to MSDN unless otherwise noted.)
| Type | Domain | Header | Data |
| tm | C (struct) | time.h |
|
| time_t, __time64_t | C (long) | time.h | |
| SYSTEMTIME | Win32 (C struct) | winbase.h |
|
| FILETIME | Win32 (C struct) | winbase.h |
|
| DATE | COM (double) | wtypes.h | |
| DBTIMESTAMP | COM (C struct) | oledb.h |
|
| CTime | MFC (class, stored as time_t member) | afx.h | |
| COleDateTime | MFC (class, stored as DATE member) | afxdisp.h | |
| java.util.Date | Java |
| From Types -> To Types V |
tm | time_t, __time64_t | SYSTEM TIME | FILE TIME | DATE | DBTIME STAMP | CTime | COle DateTime | java.util. Date |
| tm | gmtime, localtime, _gmtime64, _localtime64 | X | |||||||
| time_t, __time64_t | mktime, _mktime64 | time, _time64 (current system time) | X | Date. getTime() / 1000 | |||||
| SYSTEM TIME | FileTime ToSystemTime | ||||||||
| FILETIME | SystemTime ToFileTime | ||||||||
| DATE | |||||||||
| DBTIME STAMP | |||||||||
| CTime | X | X | X | X | |||||
| COle DateTime | X | X | X | X | X | ||||
| java.util. Date | new Date(time_t * 1000) |
SQL information taken from How to search for date and time values using Microsoft SQL Server 2000 by Bryan Syverson and MySQL Reference Manual :: 11.3.1 The DATETIME, DATE, and TIMESTAMP Types.
| Type | Minimum (YYYY-MM-DD) | Maximum (YYYY-MM-DD) | Precision |
| SQL datetime | 1753-01-01 (SQL Server), 1000-01-01 (MySQL) | 9999-12-31 | To the nearest 3.33 milliseconds |
| SQL smalldatetime | 1900-01-01 | 2079-06-06 23:59 (1 minute until midnight) | To the nearest minute |
| time_t/tm, __time64_t | 1970-01-01 00:00:00 | 2038-01-18 19:14:07, 3000-12-31 23:59:59 | seconds from the minimum time |
| FILETIME | 1601-01-01 | ||
| DATE | Zero is 1899-12-31 00:00:00 | ||
| CTime | 1970-01-01 | 2038-01-18 | |
| COleDateTime | 0100-01-01 | 9999-12-31 | |
| java.util.Date | zero is 1970-01-01 00:00:00, milliseconds from zero |
TODO: Add relevant functions, facets, and boost utilities.