#include #include #include time_t mktime_c(const int values[9] ) { struct tm m; memset(&m, 0, sizeof(struct tm)); m.tm_sec = values[0]; m.tm_min = values[1]; m.tm_hour = values[2]; m.tm_mday = values[3]; m.tm_mon = values[4]; m.tm_year = values[5]; m.tm_wday = values[6]; m.tm_yday = values[7]; m.tm_isdst= values[8]; return (time_t)mktime(&m); } time_t mkutctime_c(const int values[9] ) { struct tm m, m0; memset(&m, 0, sizeof(struct tm)); memset(&m0, 0, sizeof(struct tm)); m.tm_sec = values[0]; m.tm_min = values[1]; m.tm_hour = values[2]; m.tm_mday = values[3]; m.tm_mon = values[4]; m.tm_year = values[5]; m.tm_wday = values[6]; m.tm_yday = values[7]; m.tm_isdst= values[8]; m0.tm_sec = 0 ; m0.tm_min = 0 ; m0.tm_hour = 0 ; m0.tm_mday = 1 ; m0.tm_mon = 0 ; m0.tm_year = 70 ; m0.tm_wday = 0 ; m0.tm_yday = 0 ; m0.tm_isdst= 0 ; return (time_t)(mktime(&m) - mktime(&m0)) ; } void sub_gmtime_c(const time_t t, int values[9] ) { struct tm *m; m = gmtime( &t ); values[0] = m->tm_sec ; values[1] = m->tm_min ; values[2] = m->tm_hour ; values[3] = m->tm_mday ; values[4] = m->tm_mon ; values[5] = m->tm_year ; values[6] = m->tm_wday ; values[7] = m->tm_yday ; values[8] = m->tm_isdst; return; }