Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting old and new local times to UTC under Windows XP/Server 2003
    primarykey
    data
    text
    <p>My application converts past and present dates from local time to UTC.</p> <p>I need to ensure I will honor any future DST updates to Windows while still correctly handling past dates.</p> <p>The application is written in C++ and is running on Server 2003.</p> <p>Options I've researched:</p> <ul> <li><p><a href="http://msdn.microsoft.com/en-us/vstudio/bb264729.aspx" rel="nofollow noreferrer"><code>gmtime()</code> and <code>localtime()</code> are not always correct for past dates</a> because they will only ever observe current DST rules. (<a href="https://stackoverflow.com/questions/275952/has-the-daylight-savings-rule-change-invalidated-the-c-runtime-library">related SO question</a>)</p></li> <li><p>A <a href="https://stackoverflow.com/questions/237023/is-there-a-central-repository-for-time-zone-information">tz database</a> is out because it requires a separate manual update.</p></li> <li><p><a href="http://msdn.microsoft.com/en-us/library/bb540851%28VS.85%29.aspx" rel="nofollow noreferrer"><code>GetTimeZoneInformationForYear()</code></a> is out because it requires Vista/Server 2008. </p></li> <li><p><a href="http://74.125.47.132/search?q=cache:qInlsZFBRnYJ:www.experts-exchange.com/Programming/Languages/CPP/Q_23845887.html+GetTimeZoneInformationForYear&amp;cd=8&amp;hl=en&amp;ct=clnk&amp;gl=us&amp;client=firefox-a" rel="nofollow noreferrer">Past DST information is stored in the registry</a>, but I'm looking for something higher-level. </p></li> <li><p>Boost <a href="http://www.boost.org/doc/libs/1_37_0/doc/html/date_time.html" rel="nofollow noreferrer"><code>date_time</code></a>:</p> <ul> <li>class <a href="http://www.boost.org/doc/libs/1_37_0/boost/date_time/dst_rules.hpp" rel="nofollow noreferrer"><code>us_dst_rules</code></a> is deprecated and does not update if the OS updates.</li> <li>class <a href="http://www.boost.org/doc/libs/1_38_0/doc/html/boost/date_time/dst_calc_engine.html" rel="nofollow noreferrer"><code>dst_calc_engine&lt;></code></a> is its successor, but it does not respect OS updates either. </li> </ul></li> </ul> <p>So...</p> <ul> <li><p>... is anyone else using the raw registry solution to do this?</p></li> <li><p>... any other suggestions?</p></li> </ul> <p>(edit: found out <a href="http://www.boost.org/doc/libs/1_39_0/boost/date_time/local_timezone_defs.hpp" rel="nofollow noreferrer"><code>dst_calc_engine</code> doesn't support DST updates</a>)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload