Date/Time Data Types Flashcards
datetime
From January 1, 1753 to December 31, 9999 with an accuracy of 3.33 milliseconds
datetime2
From January 1, 0001 to December 31, 9999 with an accuracy of 100 nanoseconds
smalldatetime
From January 1, 1900 to June 6, 2079 with an accuracy of 1 minute
date
Store a date only. From January 1, 0001 to December 31, 9999
time
Store a time only to an accuracy of 100 nanoseconds
datatimeoffset
The same as datetime2 with the addition of a time zone offset
timestamp
Stores a unique number that gets updated every time a row gets created or modified. The timestamp value is based upon an internal clock and does not correspond to real time. Each table may have only one timestamp variable
Format of datetime
YYYY-MM-DD HH:MI:SS
format of date
YYYY-MM-DD
format of smalldatetime
YYYY-MM-DD HH:MI:SS
format of timestamp
a unique number