www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/21/05:44:38

Date: Tue Jun 21 10:17:12 1994
From: leonardr AT eeng DOT dcu DOT ie (Roy Leonard)
To: Djgpp AT sun DOT soe DOT clarkson DOT edu, leonardr AT eeng DOT dcu DOT ie
Subject: re: gmtime,ctime and localtime functions

>
>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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019