[windev] Calculating DST switch moments of many future years

Serge Wautier serge at wautier.net
Thu Mar 26 09:49:16 GMT 2009


Hi Goran,

Yes, I remember (and if you ask for one single thing I'm happy I no longer
have to deal with it since I left the company, it's DST! ;-).
Also, I'm 99.9% sure you didn't write the original part of that code. If bug
is yours, you're doubly responsible then :-)

Would the Vista-only GetTimeZoneInformationForYear() help?
Of course, you can't assume that users run Vista. But you might use a Vista
computer to create a file containing all data and embed it into your
program.

HTH,

Serge.
http://www.apptranslator.com



> -----Original Message-----
> From: windev-bounces at windev.org [mailto:windev-bounces at windev.org] On
> Behalf Of Goran Pusic
> Sent: jeudi 26 mars 2009 10:29
> To: windev at windev.org
> Subject: [windev] Calculating DST switch moments of many future years
> 
> 
> Hi all!
> 
> I need to calculate UTC moment for DST switches for a given time zone
> (perhaps different from system's time zone), for a couple of decades in
> advance. (If it sounds like a WTF: this info is sent to an embedded
> system to help it know about it's timezone bias at every moment in
> time, for as long as it will live, so that it can calculate local
> time).
> 
> For that, I have a calculation that relies on Windows
> TIME_ZONE_INFORMATION and friends. However, recently (after some 5-6
> years after the code was written), people found out there are bugs
> inside my calculation :-( .
> 
> Now... Before I delve into this again (it's not urgent, it's for next
> autumn ;-) ), do you guys have any pointers on how to do it? Did anyone
> do it before?
> 
> HTH,
> Goran.
> 
> P.S.
> 
> Yes, I know that DST rules change, so calculation may be good now, but
> bad in the future. Nothing I can do about that, it's on shoulders of
> users.
> 
> P.P.S Hi, Serge W! Remember this? (Bug is mine, though)
> 
> 
> 
> 
> --
> Windev mailing list at Windev at windev.org
> 
> Lost your password?  Need to unsubscribe or change your delivery
> options?
> Go to http://lists.windev.org/mailman/listinfo/windev
> --
> Search the Windev Archives - www.windev.org



More information about the Windev mailing list