time after Daylight Saving Time started

Ronald van der Pol rvdp at cs.vu.nl
Wed Apr 3 22:27:34 AEST 1991


Am I the only one who's having problems with SCO 3.2.2's times? Last
weekend we changed to Daylight Saving Time. Now 'date' is telling
the wrong time (sometimes it says we are at EST :-(

syspro$ date
Tue Apr 02 14:35:16 MET 1991

syspro$ cat time.c
#include <stdio.h>
#include <time.h>

#define TIME_BUF_SIZE	50

main()
{
	struct tm	*ts;
	time_t		tp;
	char		buf[TIME_BUF_SIZE];

	tzset();
	if (time(&tp) == 0) {
		perror("time");
		exit(1);
	}
	ts = localtime(&tp);
	strftime(buf, sizeof(buf), "%a %b %d %H:%M.%S %Z", ts);
	printf("current time is %s\n", buf);
}

syspro$ cc -o time time.c
time.c
syspro$ ./time
current time is Tue Apr 02 15:36.56 MET

syspro$ echo $TZ
MET-1MET_DST,M3.5.0,M9.5.0

So it should be Tue Apr 02 15:37.00 MET_DST

What is going on?

--
	Ronald van der Pol    <rvdp at cs.vu.nl>



More information about the Comp.unix.sysv386 mailing list