|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 3:42 PM
Points: 2,013,
Visits: 5,937
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, December 08, 2009 9:03 AM
Points: 336,
Visits: 42
|
|
| What is the DateTime2 and DateTimeOffset?
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 6:19 PM
Points: 805,
Visits: 1,805
|
|
To save y'all the trouble of clicking each MSDN link given in the solution, here are my condensations of the basic definitions....
date Defines a date. Three bytes with a range of 0001-01-01 through 9999-12-31.
time Defines a time of day. Optionally specify a precision for the fractions of a second. Three to five bytes depending on precision (0-7 digits for fraction of second).
datetime2 Defines a date that is combined with a time of day that is based on 24-hour clock. datetime2 can be considered as an extension of the existing datetime type that has a larger date range (0001-01-01 through 9999-12-31), a larger default fractional precision, and optional user-specified precision (0-7 digits for fraction of second). Six to eight bytes depending on precision.
datetimeoffset Defines a date that is combined with a time of a day that has time zone awareness and is based on a 24-hour clock. Similar to datetime2 with the addition of storing the offset from UTC from -14:00 to +14:00. Ten bytes.
And, for comparison... datetime Defines a date that is combined with a time of day with fractional seconds that is based on a 24-hour clock. Date range is January 1, 1753, through December 31, 9999. Time range is 00:00:00 through 23:59:59.997 rounded to increments of .000, .003, or .007 seconds. Eight bytes.
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Yesterday @ 11:37 AM
Points: 779,
Visits: 1,025
|
|
Good question. A lot of people will like the separate date and time.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Thursday, February 11, 2010 7:52 AM
Points: 3,463,
Visits: 976
|
|
|
|
|