Home:ALL Converter>How does DateTimeOffset deal with daylight saving time?

How does DateTimeOffset deal with daylight saving time?

Ask Time:2011-09-26T18:53:05         Author:Stephen Kennedy

Json Formatter

I am storing schedules in the database as a day of the week, hour and minute. When the data is read we create a DateTime object for the next occurrence of that day, hour and minute, but I need to modify this to be DST-aware. I am able to modify the database if necessary.

I know that DateTimeOffset stores a UTC date/time and an offset. I also know from this MSDN blog entry that DateTimeOffset should be used to "Work with daylight saving times".

What I'm struggling to understand is exactly how DateTimeOffset "work(s) with daylight saving times". My understanding, little that there is, is that daylight saving times are a political decision and cannot be inferred from purely an offset. How can it be that this structure is DST friendly if it only stores an offset and not a named timezone or country?

Author:Stephen Kennedy,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7553997/how-does-datetimeoffset-deal-with-daylight-saving-time
yy