#include #include #include #include void main() { short delta_year; time_t now, then; char *ctime_str, *gmtime_str; now = time(0); then = (time_t)(2147483648-3601); ctime_str = ctime(&then); printf("ctime(%ld) == %s\n", (long)then, ctime_str); then = (time_t)(2147483648-3600); ctime_str = ctime(&then); printf("ctime(%ld) == %s\n", (long)then, ctime_str); for(delta_year=0 ; delta_year < 50; delta_year++ ) { then = now + (long)(delta_year*60*60*24*365.2422); printf("Year : %4.4d (time == %ld)\n", 1997+delta_year, (long)then); ctime_str = ctime(&then); gmtime_str = asctime(gmtime(&then)); printf(" ctime == %s gmtime == %s\n", ctime_str, gmtime_str); } }