1.5.17 ctime issue (Win2K)

gary.mcdowell@dstintl.com gary.mcdowell@dstintl.com
Thu Jun 30 15:32:00 GMT 2005





The analysis I've performed.

1) Change the windows timezone to +9:30 Adelaide, Daylight Savings (DST)
on, windows clock changes to 00:16
2) Start csh.exe and echo $TZ,
(Embedded image moved to file: pic18588.jpg)
3) Run test executable program:

#include <time.h>
#include <stdio.h>

int main()
{
    /* time_t is unsigned long */
    time_t  time_t1;
    char    pcTime1[100];

    time(&time_t1);

      printf ("daylight=%d\n_daylight=%d\n", daylight, _daylight);

      tzset();

    strftime(pcTime1,99,"%Y%m%d %H%M%S %Z",localtime(&time_t1));

    printf( "\ntime() = %d\ncftime() = %s\nctime() =
%s\ndaylight=%d\n_daylight=%d",
            time_t1,
            pcTime1,
            ctime(&time_t1), daylight, _daylight);

      return 0;
}

Get reported back ctime of 01:16 - one hour in advance of Windows clock.
Note that in this timezone, at this time of year daylight savings is not
applicable until October.

4) Change the windows timezone to +9:30 Adelaide, Daylight Savings (DST)
off, windows clock stays the same - DST not applicable (see above).
5) Start csh.exe and echo $TZ,
(Embedded image moved to file: pic06422.jpg)
6) Run test executable program:

Get reported back ctime of 01:16 - one hour in advance of Windows clock
still.

7) Change the month in windows to November - Daylight savings is now in
affect for this Timezone and DST is set to on. Note windows says the time
is 01:19.
8) Start csh.exe and echo $TZ,
(Embedded image moved to file: pic24946.jpg)
9) Run test executable program.
Get reported back ctime of 00:19 - one hour prior to windows.

10) Change the daylight savings to off in windows, windows sets time to
00:20
11) Start csh.exe and echo $TZ,
(Embedded image moved to file: pic27506.jpg)
12) Run the test executanle program.
Get reported back a ctime of 00:19 - now the same time as windows.

My point here is that ctime does not seem to be accurately keeping step
with windows and is determining the daylight savings based on something I
can;t locate. In the instance when daylight savings is not in affect it
means the time is out by one hour.

Can someone please verify my findings and confirm I'm not going mad or is
this a known madness I can cure?

Thanks
Gary
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

http://www.dstinternational.com

Notice: This e-mail and any attachments are intended only for the individual 
or company to which it is addressed and may contain information which is
privileged, confidential and prohibited from disclosure or unauthorized
use under applicable law.  If you are not the intended recipient of this
e-mail, you are hereby notified that any use, dissemination or copying of 
this e-mail or the information contained in this e-mail is strictly 
prohibited by the sender.

Whilst we run anti-virus software on all internet e-mails we are not liable
for any loss or damage.  The recipient is advised to run their own anti-virus
software.

If you have received this transmission in error, please return the material
received to the sender and delete all copies from your system. Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic18588.jpg
Type: image/jpeg
Size: 4269 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050630/a8a1b465/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic06422.jpg
Type: image/jpeg
Size: 4082 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050630/a8a1b465/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic24946.jpg
Type: image/jpeg
Size: 4269 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050630/a8a1b465/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic27506.jpg
Type: image/jpeg
Size: 4082 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050630/a8a1b465/attachment-0003.jpg>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list