I know that DateTimeOffset stores UTC date / time and offset. I also know from this MSDN blog post that DateTimeOffset should be used for "Working with the summer days."
What I'm trying to understand is exactly the same as DateTimeOffset "works with daylight saving time." My understanding, not only is there, that daylight saving time is a political decision and cannot be removed from a pure bias. How can it be that this structure is DST friendly if it only stores offset?
I am going to use the TimeZoneInfo method in combination with DateTimeOffset. How should I do it?
Finally, are there any better ways I could achieve the following?
(I saw several posts from Jon Skeet about Noda-Time , but I don’t know if this is ready, but I don’t know if it will integrate well into our existing solution).
Here is our script. The server for unsuccessful inherited reasons works in the UK. We have clients who are starting to enter the stream from Australia with several time zones. Other countries may be operational at any time.
We have a scheduler based on the hard disk scheduler (uses DateTimeOffset). It works very well. However, in our database we store enough data to create a DateTime object (see below), and in our subclass and plumbing code we just use DateTime, since initially we only supported users from the UK.
This planner is responsible for the immobilization and mobilization of plant equipment. Therefore, it is vital that scheduled events run in local time configured by the DST user.
A user enters a schedule on our website; it is currently stored in the database as the day of the week, hour and minute. When the data is read, we create a DateTime object for the next occurrence of this day, hour and minute. I can change the structure of db to further preserve the offset or time zone.
When this date and time is reached, the scheduler sends a command (and retries for a while). Then it starts again on the same day and next week (although the service will actually be redesigned by then and the code will start again).
All I need to achieve is to run the scheduled events at the local date and time set by the time zone for this user, using the scheduler, which subclasses from Hardcodet. If DateTimeOffset really supports DST, maybe all I have to do is save the offset and change our plumbing code to use this structure, but I get the impression that it's not so simple. (We can get the current time zone from the GPS installation position, but this is a discussion for another day :)).