!! Fun With Timezones !! 
Author Message
 !! Fun With Timezones !!

No, it's correct.  It is non-zero if a DST-(using)- zone is specified.
Certain states (Indiana, Arizona) do NOT use DST.  For them,
this value is zero, and the machine makes no attempt to correct
time for DST.  For beautiful New Jersey, you do switch,  and the
flag to tell the computer to make the switch and is _daylight == 1.

I'm not sure how you find out whether DST is currently active or not,
without parsing the results of the functions.  But since the machine
takes care of it for you, why do you care ?

    It's November, I'm here in beautiful New Jersey, in the Eastern time
zone.  Since it's November, it's Eastern Standard Time.  In the summer, it's
Eastern Daylight Savings Time.

     There's an enviroment variable called "_daylight" that VC help
describes as:
    _daylight - Nonzero value if a daylight-saving-time zone is specified in
TZ setting; otherwise, 0

    So it's nozero (read "1") if it is Daylight Savings Time.  It's
November, so it is not Daylight Savings Time.  So _daylight should be 0 this
time of year, right?  Well, its not on 4 NT boxes or 1 Win95 machine here.
It says "1".



Sun, 13 May 2001 03:00:00 GMT  
 !! Fun With Timezones !!

Quote:

> That's a reasonable explanation of what _daylight does, although the explanation on MSDN leaves something to be desired.  What I need to know for my application is how many hours away from Greenwich Mean Time we are.  During Eastern Standard Time, we are 5 hours off GMT.  During Eastern Daylight SavingsTime, we are 4 hours off GMT.

> But, if you just use the _timezone variable, it is not adjusted by the daylight savings time switch.

> Again, I have attached a simple program.  It says we are 5 hours offset today, which is true.  But if I set the machine's clock to July, say, it still says we are 5 hours offset.

> Does anybody know how to find out how many hours from GMT the computer is?

> Thanks!
>   Mike

The GetTimeZoneInformation API appears to provide that info.


Tue, 15 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Fun Fun Fun

2. Automatic DateTime formating between TimeZones?

3. Date and Time in Different Timezones

4. time_t, tm*, and timezones (please read!)

5. Q: conversion between timezones

6. time_t, tm*, and timezones (please read!)

7. Timezones

8. Timezones

9. Timezones

10. Timezones

11. timezones and universal coordinated time

12. TimeZones Abbreviated

 

 
Powered by phpBB® Forum Software