TimeZoneInfo vs. Olson database

2020-08-18 04:52发布

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.

2条回答
放荡不羁爱自由
2楼-- · 2020-08-18 05:40

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).

查看更多
欢心
3楼-- · 2020-08-18 05:47

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?

查看更多
登录 后发表回答