.NET Framework & SQLServer 日期与时间范围
.NET Framework DateTime Types
| Date Type | DateRange |
| DateTime |
00:00:00.0000000, January 1, 0001 23:59:59.9999999, December 31, 9999 |
| SqlDateTime | January 1, 1753 December 31, 9999 |
SQL Server Date & Time Types
| Date Type | Storage(bytes) | DateRange | Precision | Recommanded Entry Format and Example |
| DATETIME | 8 |
January 1, 1753 |
3 1/3 milliseconds |
‘YYYYMMDD |
| SMALLDATETIME | 4 |
January 1, 1900 |
1 minute |
‘YYYYMMDD |
| DATE | 3 |
January 1, 0001 |
1 day |
‘YYYYMMDD’ |
| TIME(p) | 3 to 5 |
|
100 nanoseconds | ‘hh:mm:ss .nnnnnnn’ ‘12:30:15 .1234567’ |
| DATETIME2(p) | 6 to 8 |
January 1, 0001 |
100 nanoseconds | ‘YYYY-MM-DD hh:mm:ss .nnnnnnn’ ‘2009-02-12 12:30:15 .1234567’ |
| DATETIMEOFFSET(p) | 8 to 10 |
January 1, 0001 |
100 nanoseconds |
‘YYYY-MM-DD |

浙公网安备 33010602011771号