20 return datetime_error(-1,
"datetime_is_leap_year(): illegal year");
26 return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
42 return datetime_error(-1,
"datetime_days_in_year(): illegal year");
63 static int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
65 if (month < 1 || month > 12)
66 return datetime_error(-1,
"datetime_days_in_month(): illegal month");
71 return (days[month - 1]);
int datetime_days_in_month(int year, int month, int ad)
returns number of days in 'month' of a particular 'year'
int datetime_is_leap_year(int year, int ad)
int datetime_days_in_year(int year, int ad)
returns the number of days in 'year'
int datetime_error(int code, char *msg)
record 'code' and 'msg' as error code/msg (in static variables) code==0 will clear the error (ie set ...