DateTimeZone to / from the database

I am trying to figure out using Noda Time from Jon Skeet (and others).

How to save DateTimeZone and get it from the database. I thought that the value of the Id property can be set for the database, but how to create a DateTimeZone from the identifier, since DateTimeZone is an abstract class?

+6
source share
1 answer

Saving an identifier is fine, and you will return it using the appropriate IDateTimeZoneProvider and its indexer , usually retrieved through DateTimeZoneProviders . For instance:

 var london = DateTimeZoneProviders.Tzdb["Europe/London"]; 

You need to know which provider you used, of course - identifiers are only limited by the provider.

+6
source

All Articles