135 memset(&t, 0,
sizeof(t));
139 t.tm_sec = (((int)dostime << 1) & 0x3E);
140 t.tm_min = (((int)dostime >> 5) & 0x3F);
141 t.tm_hour = (((int)dostime >> 11) & 0x1F);
142 t.tm_mday = (((int)dostime >> 16) & 0x1F);
143 t.tm_mon = (((int)dostime >> 21) & 0x0F) - 1;
144 t.tm_year = (((int)dostime >> 25) & 0x7F) + 80;
146 if(t.tm_year < 80 || t.tm_year > 207
147 || t.tm_mon < 0 || t.tm_mon > 11
148 || t.tm_mday < 1 || t.tm_mday > 31
149 || t.tm_hour < 0 || t.tm_hour > 23
150 || t.tm_min < 0 || t.tm_min > 59
151 || t.tm_sec < 0 || t.tm_sec > 59)
190 if(year < 1980 || year > 2107
191 || month < 1 || month > 12
192 || day < 1 || day > 31
193 || hour < 0 || hour > 23
194 || minute < 0 || minute > 59
195 || second < 0 || second > 59)
224 even_time = (unix_time + 1) & ~1;
225 s = localtime(&even_time);
226 return dostime(s->tm_year + 1900, s->tm_mon + 1, s->tm_mday,
227 s->tm_hour, s->tm_min, s->tm_sec);
dostime_t maxdostime()
Return the maximum possible value .
dostime_t unix2dostime(time_t unix_time)
Convert a Unix date to a DOS date.
dostime_t dostime(int year, int month, int day, int hour, int minute, int second)
time_t dos2unixtime(dostime_t dostime)
Convert a DOS time to a Unix time.
Definitions for the MS-DOS to Unix time conversions.
dostime_t mindostime()
Return the minimum possible value.