Historical daylight savings in Windows

最后都变了- 提交于 2019-12-06 11:48:05

Funny, a very similar question appeared yesterday on LinkedIn.

This is the answer I gave there:

Time Zones are somewhat fluid, especially when Daylight Saving Time starts/finishes.

This database ( http://en.wikipedia.org/wiki/Tz_database ) defines the time zones, and it changes sometimes, so you need an update mechanism as well.

There is a .NET implementation that you could wrap, or use as a base: http://www.codeproject.com/KB/locale/zoneinfo_dotnet_api.aspx

I'm not sure how up to date this Delphi implementation is: http://sourceforge.net/projects/delphitz/

Let us know your final implementation.

Edit: The project mentioned above seems empty, so I searched further and found the Delphi TimeZone Database project to be still active.

--jeroen

Windows does not store historical data, you will need to use a database such as the tz database. I couldn't find any Delphi code listed on that particular page, but there might be some floating around. Otherwise, you'll have to port it from one of the languages that are currently supported...

lkessler

How about: Convert UTC string to TDatetime in Delphi

Also, there is some discussion and Delphi code for doing this at: http://www.tek-tips.com/viewthread.cfm?qid=1486209&page=1

And you can find a fair bit on this with a Google search for: utc local delphi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!