version 1.3, 1998/02/23 05:48:42 |
version 1.4, 1998/03/30 06:59:26 |
|
|
time_t now; |
time_t now; |
{ |
{ |
tp = localtime(&now); |
tp = localtime(&now); |
if (isleap(tp->tm_year + 1900)) { |
if (isleap(tp->tm_year + TM_YEAR_BASE)) { |
yrdays = DAYSPERLYEAR; |
yrdays = DAYSPERLYEAR; |
cumdays = daytab[1]; |
cumdays = daytab[1]; |
} else { |
} else { |
|
|
char *date; |
char *date; |
{ |
{ |
time_t t; |
time_t t; |
char save; |
|
int len; |
int len; |
struct tm tm; |
struct tm tm; |
|
|
|
|
*(date + len - 4) = '\0'; |
*(date + len - 4) = '\0'; |
tm.tm_year = atoi(date); |
tm.tm_year = atoi(date); |
|
|
/* tm_year up 1900 ... */ |
/* tm_year up TM_YEAR_BASE ... */ |
if (tm.tm_year > 1900) |
if (tm.tm_year < 70) |
tm.tm_year -= 1900; |
tm.tm_year += 2000 - TM_YEAR_BASE; |
|
else if (tm.tm_year < 100) |
|
tm.tm_year += 1900 - TM_YEAR_BASE; |
|
else if (tm.tm_year > TM_YEAR_BASE) |
|
tm.tm_year -= TM_YEAR_BASE; |
} |
} |
|
|
#if DEBUG |
#if DEBUG |