views:

734

answers:

1

I want to convert various location/date/times in history from GMT to local time. It seems that SystemTimeToTzSpecificLocalTime is better than FileTimeToLocalFileTime. When the date/time pairs also include various locations, the conversion gets hairy. I've found a data set at ftp://elsie.nci.nih.gov/pub/ that seems to be nicely complete through history and space, but it appears to be designed to be compiled for one time zone instead of all of them.

GetDynamicTimeZoneInformation and GetTimeZoneInformationForYear functions are only available beginning in Vista / Server 2008 and I have machines back to NT 4.0. I will probably try to use them conditionally on the newer systems.

Is there a nice C package that will solve the problem for me for Windows XP and NT 4.0?

+1  A: 

SystemTimeToTzSpecificLocalTime is the right function for this, but you need a way to populate a complete database of TIMEZONE_INFO structures.

For details on how you can build a set of TIMEZONE_INFO structures out of the registry itself, see this thread on egghead cafe:
http://www.eggheadcafe.com/software/aspnet/31656478/get-current-time-in-diffe.aspx

To get things truly correct across legislative changes, you'll need GetDynamicTimeZoneInformation and GetTimeZoneInformationForYear. See http://msdn.microsoft.com/en-us/library/ms724421(VS.85).aspx.

Dave Moore
Thank you for your reply -- I've updated my question to reflect information you gave.
piCookie