Mail Archives: djgpp/1994/06/21/05:44:38
>
>I wrote the following program to test the gmtime, ctime and localtime
>functions:
>
>...
>
>Is there a bug in the ctime and localtime functions?
>
> MCMIII
> Murle Cleveland Meetze III
> meetze AT charlie DOT ece DOT scarolina DOT edu
>
I tried out your program on my PC and got a similar response.
The problem seems to be that your PC does not know what time
zone it is in. (Your Unix system has already been told).
If you include the following line in your program:
char *tzstr = "TZ=PST8PDT";
Replacing the right hand side with your relevant settings, you
should get the correct time from your PC. gmtime and localtime
make use of the above variable.
xxx[+/-]d[d]yyy
xxx = Three character name of the current time zone
[+/-]d[d] = The difference between the local time zone
and GMT in hours.
yyy = Daylight saving?
If this field is present, it will cause daylight
saving to be taken into account.
hope this is of some use to you
Roy Leonard
- Raw text -