94 static int tmcomp(
register const struct tm *
const atmp,
95 register const struct tm *
const btmp)
99 if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
100 (result = (atmp->tm_mon - btmp->tm_mon)) == 0 &&
101 (result = (atmp->tm_mday - btmp->tm_mday)) == 0 &&
102 (result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
103 (result = (atmp->tm_min - btmp->tm_min)) == 0)
104 result = atmp->tm_sec - btmp->tm_sec;
111 register int saved_seconds;
113 struct tm yourtm, *mytm;
116 saved_seconds = yourtm.tm_sec;
123 for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
129 t = (t < 0) ? 0 : ((time_t) 1 << bits);
134 if(bits > 40) bits = 40;
139 if(!mytm)
return WRONG;
141 dir =
tmcomp(mytm, &yourtm);
148 t -= (time_t) 1 << bits;
149 else t += (time_t) 1 << bits;
static int tmcomp(register const struct tm *const atmp, register const struct tm *const btmp)
time_t mkgmtime(struct tm *const tmp)
Get the UTC time in seconds and nano-seconds from a time struct in GM time.