My application converts past and present dates from local time to UTC.
I need to ensure I will honor any future DST updates to Windows while still correctly handling past dates.
The application is written in C++ and is running on Server 2003.
Options I've researched:
gmtime()
andlocaltime()
are not always correct for past dates because they will only ever observe current DST rules. (related SO question)A tz database is out because it requires a separate manual update.
GetTimeZoneInformationForYear()
is out because it requires Vista/Server 2008.Past DST information is stored in the registry, but I'm looking for something higher-level.
Boost
date_time
:- class
us_dst_rules
is deprecated and does not update if the OS updates. - class
dst_calc_engine<>
is its successor, but it does not respect OS updates either.
- class
So...
... is anyone else using the raw registry solution to do this?
... any other suggestions?
(edit: found out dst_calc_engine
doesn't support DST updates)