OK, if I understand the man pages, the following program should
print
Wed Jul 1 08:30:00 1998
But it doesn't. Instead it prints
Wed Jul 1 09:30:00 1998
This occurs under Linux 2.0.32, Solaris 2.5.1, SunOs. A similar program
in Perl produces a similar result. What am I failing to do or understand?
Thanks in advace for any advice. E-mail is fine, and I'll summarize.
#include <time.h>
#include <stdio.h>
int main(void)
{
struct tm t = { 0, /* seconds */
30, /* minutes */
8, /* hours since midnight */
1, /* day of month */
6, /* months since January */
98, /* years since 1900 */
0, /* day of week (reset by mktime) */
0, /* day of year (reset by mktime) */
0}; /* daylight/standard switch */
/* --changing has no effect */
time_t c;
c = mktime(&t);
printf("%s\n", ctime(&c));
return 0;
}
--
Matthew Saltzman
Clemson University Math Sciences