Do TimeZoneInfo and Olson database use identical identificators for time zones?
I get timezone id from GeoNames service (which is based on Olson database) and want to retrieve day light saving information for that timezone.
The tz database is a collaborative compilation of information about the world's time zones, primarily intended for use with computer programs and operating systems. Paul Eggert is its current editor and maintainer, with the organizational backing of ICANN.
From east to west they are Atlantic Standard Time (AST), Eastern Standard Time (EST), Central Standard Time (CST), Mountain Standard Time (MST), Pacific Standard Time (PST), Alaskan Standard Time (AKST), Hawaii-Aleutian Standard Time (HST), Samoa standard time (UTC-11) and Chamorro Standard Time (UTC+10).
Rule 2: Use an Appropriate Data Type Oracle: Use the TIMESTAMP WITH TIME ZONE data type as this can store the timezone of UTC. SQL Server: Use the DATETIMEOFFSET data type, which can store the timezone of UTC. MySQL: Use the TIMESTAMP data type which can include a timezone component.
What Is UTC? UTC—Coordinated Universal Time—is the 24-hour time standard used as a basis for civil time today. All time zones are defined by their offset from UTC. The offset is expressed as either UTC- or UTC+ and the number of hours and minutes.
The unicode consortium keeps a mapping between Olson database and Windows TimeZone Ids, which can be accessed here.
Also see this SO question and answers for more daylight savings info (Daylight saving time - do and don’ts).
No they don't use the same identifiers. A possible solution is to use Noda-Time which foregoes TimeZoneInfo in favour of Olson timezones.
Further reading: What's wrong with DateTime anyway?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With