97 register const struct
tm * const atmp;
98 register const struct
tm * const btmp;
102 if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
103 (result = (atmp->tm_mon - btmp->tm_mon)) == 0 &&
104 (result = (atmp->tm_mday - btmp->tm_mday)) == 0 &&
105 (result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
106 (result = (atmp->tm_min - btmp->tm_min)) == 0)
107 result = atmp->tm_sec - btmp->tm_sec;
113 struct
tm * const tmp;
117 register int saved_seconds;
119 struct tm yourtm, mytm;
122 saved_seconds = yourtm.tm_sec;
129 for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
135 t = (t < 0) ? 0 : ((time_t) 1 << bits);
140 if(bits > 40) bits = 40;
145 dir = tmcomp(mytm, &yourtm);
152 t -= (time_t) 1 << bits;
153 else t += (time_t) 1 << bits;
Utility functions for operating on UTC times.
time_t tm_to_epoch(struct tm *const tmp)
Convert a tm struct to a UNIX epoch.
void epoch_to_tm(const time_t *timer, struct tm *const tmp)
Convert a UNIX epoch to a tm struct.