41 return ((year % 400) == 0) || (((year % 4) == 0) && ((year % 100) != 0));
51 time_t val = tm->tm_sec + (tm->tm_min * 60) + (tm->tm_hour * 3600) + (tm->tm_yday * 86400);
53 int year = 1900 + tm->tm_year;
54 for (
int i = 1970; i < year; i++)
time_t timegm(struct tm *tm)
Convert struct tm to time_t seconds since epoch.
static time_t tm_to_sec(struct tm *tm)
Convert a time structure to number of seconds since the epoch.
static bool is_leap_year(int year)
Is this a Leap Year?