01-17-2011 02:31 AM
Using CVI 2009 SP1 I see that I can use localtime() to see if a specified GMT converted into time zone is during DST.
But I noticed that the tm_isdst field is updated in the right way only if I set it to -1 before calling localtime().
This behaviour is similar to the one described in the Microsoft's help for time functions:
When specifying a tm structure time, set the tm_isdst field to:
Has the CVI localtime() the same behaviour?
01-17-2011 02:54 AM
I did other tests, and I was wrong:
localtime() sets tm_isdst only if at the boot time the MS Windows option "Automatically adjust clock for daylight saving changes" is enabled (even if you disable it after the boot).
If this option is disabled at boot time, localtime always return tm_isdst = 0 (DST not in effect).
Calling mktime() after having set tm_isdst = -1 doesn't help (different behaviour from the one described in the Microsoft's KB).
I'm afraid the only successful way is the one described here (http://forums.ni.com/t5/LabWindows-CVI/See-if-specified-Time-from-time-zone-is-during-DST-Anyone-hav...
01-18-2011 03:36 AM
Dear Vix,
I suggest you to visit the following webpage:
http://weseetips.com/2008/05/28/how-to-convert-local-system-time-to-utc-or-gmt/
Regards,
01-20-2011 01:16 AM
The only successful way when the option "Automatically adjust clock for daylight saving changes" is disabled is the one described by Colin in this post
cdk 52 wrote:
You can use Windows SDK functions to accomplish this (refer to the SDK Help):
Note that CVI's Utility library provides a GetSystemTime() function; check the CVI Help for precautions you may need to take.