[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cifs
Subject:    Re: NT GMT time reporting
From:       Bruce Leverett <Bruce_Leverett () TRANSARC ! COM>
Date:       1997-04-22 13:37:04
[Download RAW message or body]


The following excerpts might help.  In reading the first one, it might be
relevant to know that I was running NT 3.5.1, and the message was written in
February, when we were on Standard time:

>                                                             I wrote the
>following C program to print the result of time():
>
>#include <time.h>
>main(){
>time_t ltime = time(NULL);
>printf("time is %d\n", ltime);
>}
>
>I compiled and linked, and then tried running this program in different
>time zones.  I used the Control Panel "Date/Time" doodad to put myself in
>different time zones.
>
>I found that there was a difference of about 3600 in the output, depending
>on whether I chose "Indiana (East)", or chose "Eastern Time (US & Canada)"
>and clicked the button so that it wouldn't "Automatically Adjust for Daylight
>Savings Time".
>
>                                                   But it also raises a lot of
>questions.  I found that, even without selecting Indiana, I was able to get
>a 3600-second difference by clicking the DST button.  But why?  It's February,
>after all.

My colleague Ron Faulkner, after doing some further experimentation on both
NT 3.5.1 and NT 4.0 (I don't know what Patch Level if any), then made the
following report.  This was also written in February.

>O.K. so here's what I've found.
>
>First, an interesting point that may or may not be related.  NT 3.51 and 4.0
>appear to react differently when changing the time zone setting.  In 3.51,
>It's 2:00pm and I change my time zone setting from Eastern to Central, The
>"clock application" will still say 2:00pm after the change, but the value
>returned by time() will decrease by 3600 seconds.  In 4.0, if I do the same
>thing, "clock" will now say 1:00pm, but the value returned by time() will stay
>the same.  Both are correct, technically.
>
>For the purposes of this discussion, I'm going to assume it's the middle of
>winter, so that Daylight Savings Time is not a factor, whether or not the
>"adjust for DST" option is set.  Let's also assume that we're talking about NT
>4.0 and the way that it handles timezone changes.
>
>Again, as I mentioned above if I change my timezone setting from Eastern
>(GMT-5) to Central (GMT-6) the user's "clock" application will immediately
>adjust to 1:00pm.  The internal clock setting only increments by the ten
>seconds or so that it takes to make the change and check time().  The Indiana
>(GMT-5) timezone should be identical to the Eastern timezone in February.  If
>I change from Eastern to Indiana, the Clock application still displays 2:00pm
>(as expected), but time() now increases by 10800 seconds (three hours????).
>
>Another example.  If it's 2:00pm in the central timezone and I change to
>Indiana I would expect to see either Clock change from 2:00 to 3:00 -OR- GMT
>to decrease by 3600 seconds (either way, we expect to widen the gap between
>local time and GMT by an hour).  That's not what I get.  What happens is that
>Clock changed from 2:00 to 3:00 -AND- Time() INCREASED by 10800 seconds.  What
>gives?
>
>I had similar results when doing the same type of test using Mountain (GMT-7),
>Arizona (GMT-7, no DST), and Pacific (GMT-8).  The difference is that the
>value returned by time() was only adjusting by 3600 seconds (1 hr) instead of
>10,800 seconds (3 hr).
>
>Another item to note, I've seen nothing unexpected in NT's behavior when
>dealing with daylight savings time settings in the timezones that use it.  The
>only relevance to DST is that the 'buggy' time zone settings appear to be the
>ones that don't use DST.
>
>
>Here are my results.  These are the relevant time values for roughly the same
>point in time:
>
>Date:  February 12, 1997
>Time:  2:00pm Eastern Standard Time
>Environment:  Windows NT Workstation 4.0 (no service packs).  Time() display
>program compiled with MS Visual C++ 4.2.  Clock.exe program packaged with Win
>NT 4.0.
>
>(Note that it took me 1 minute 55 seconds to get the samples)
>
> Time Zone Setting                   Local Time     time()
>
>Eastern (GMT-5, adjust for DST)         2:00      855774006
>Indiana (GMT-5)                         2:00      855784820 (+10800)
>(indicates GMT-2)
>Central (GMT-6, adjust for DST)         1:01      855774041
>Mountain (GMT-7, adjust for DST)       12:01      855774077
>Arizona (GMT-7)                        12:01      855777697 (+3600)
>(indicates GMT-6)
>Pacific (GMT-8, adjust for DST)        11:02      855774121

I think that Ron may have obtained a bug number for this, from Microsoft.
I can look it up if it would be helpful.

----------------------------------------------------------------
Mailing List User's Guide; includes instructions for unsubscribing:
http://www.microsoft.com/sitebuilder/resource/mailfaq.asp.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic