|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Yesterday @ 9:11 PM
Points: 54,
Visits: 923
|
|
mtassin (4/18/2011) Make a table... . . . INSERT the daylight savings start and stop times plus the offset to use. . . . Now JOIN to this table . . .
Of course if you operate in more than one country (or even in more than one state in Australia - don't know if everywhere in the US has the same DST rules), this table would get way more complicated where you have different places with different DST rules.... You'd have to add in a time zone name column too, which would then also need to get stored along with your datetimeoffset value in every table where you want to use the information - back to needing two columns to store your time data.
Having a 'DST' bit in the datetimeoffset type would be the best resolution. I would have thought they could add a bit quite easily - perhaps an extra bit of 'precision'.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 7:36 PM
Points: 584,
Visits: 1,572
|
|
Thanks for the article. My only suggestion is that I think you might have made a stronger point by using 'hour' for your DATEDIFF examples as timezone differences are [usually] measured in hours. But otherwise I think you did good by raising awareness of this feature.
It's worth mentioning that another 2008 feature, Data Collection, stored its results in UTC time. This threw me at first until I dug into the schema and then BOL'd datetimeoffset. I'd much rather have known about this earlier. (I was writing my own reports, btw. Not meaning to suggest that the Data Collection reports themselves are UTC time.)
As to daylight savings time being a consideration for functions, I fear this would be too unwieldy. There's a lot of different start-end dates for these, including many 'one-off' examples (ie: the Sydney 2000 Olympics garnered an extended DS period for just that year) and it would be a job in itself to maintain that system.
Steve.
|
|
|
|