If I use NodaTime to convert a future date and time to UTC, it uses the Offset of that future date (as known from the global offset database), what happens if suddenly that future offset for a particular Timezone changes because of a Govt change or State referendum changes it (like might happen in QLD and SA in Australia)? Now all my future dates would be out by whatever change they make... It seems unlikely but it is still a valid scenario to think about...
Firstly, you would need to update the data in order to know about the change, and obtain an appropriate IDateTimeZoneProvider
in your code. Instructions for that are in the user guide but we hope to make it simpler in the future. In particular:
So that's the matter of getting the new data. How you use it is another matter. If you have stored UTC in your database, you will end up getting a different local time when you later apply the new time zone data to the same timestamps. If that's not what you want to happen - if your app deals with users scheduling events in local time - then you should be storing local time and the time zone, so that a change to the time zone data means a change to the instant in time when the event happens, rather than a change to the local time at which it happens. Of course, you then need to consider what happens if someone scheduled an event at a local time which was going to exist, but later turned out to be a "skipped time" where the clocks are adjusted past it. Noda Time can't make those choices for you, but it does allow you to express your decision reasonably easily with a ZoneLocalMappingResolver
delegate, possibly created or obtained via the Resolvers
class.
See more on this question at Stackoverflow