Lines Matching +full:start +full:- +full:year
2 * CDDL HEADER START
68 if ((unix_time->tv_sec == 0) && (unix_time->tv_nsec == 0)) in smb_time_unix_to_nt()
71 nt_time = unix_time->tv_sec; in smb_time_unix_to_nt()
73 nt_time += unix_time->tv_nsec / 100; in smb_time_unix_to_nt()
84 if ((nt_time == 0) || (nt_time == -1)) { in smb_time_nt_to_unix()
85 unix_time->tv_sec = 0; in smb_time_nt_to_unix()
86 unix_time->tv_nsec = 0; in smb_time_nt_to_unix()
94 * both directions as 0:0 (unix-to-nt, nt-to-unix). in smb_time_nt_to_unix()
97 unix_time->tv_sec = 0; in smb_time_nt_to_unix()
98 unix_time->tv_nsec = 100; in smb_time_nt_to_unix()
102 nt_time -= NT_TIME_BIAS; in smb_time_nt_to_unix()
104 unix_time->tv_sec = seconds; in smb_time_nt_to_unix()
105 unix_time->tv_nsec = (nt_time % 10000000) * 100; in smb_time_nt_to_unix()
116 * date/time field is set to -1 is not documented but is
118 * If date or time is 0 or -1 the unix time is returned as 0
127 ((date == -1) || (time == -1))) { in smb_time_dos_to_unix()
132 atm.tm_mon = ((date >> 5) & 0x0F) - 1; in smb_time_dos_to_unix()
159 i += atm.tm_year - 80; in smb_time_unix_to_dos()
182 * Thread-safe version of smb_gmtime. Returns a null pointer if either
195 int year; in smb_gmtime_r() local
204 tsec -= tzh_leapcnt; in smb_gmtime_r()
206 result->tm_wday = tsec / SECSPERDAY; in smb_gmtime_r()
207 result->tm_wday = (result->tm_wday + TM_THURSDAY) % DAYSPERWEEK; in smb_gmtime_r()
209 year = EPOCH_YEAR; in smb_gmtime_r()
210 while (tsec >= (isleap(year) ? (SECSPERDAY * DAYSPERLYEAR) : in smb_gmtime_r()
212 if (isleap(year)) in smb_gmtime_r()
213 tsec -= SECSPERDAY * DAYSPERLYEAR; in smb_gmtime_r()
215 tsec -= SECSPERDAY * DAYSPERNYEAR; in smb_gmtime_r()
217 ++year; in smb_gmtime_r()
220 result->tm_year = year - TM_YEAR_BASE; in smb_gmtime_r()
221 result->tm_yday = tsec / SECSPERDAY; in smb_gmtime_r()
226 if (month == TM_FEBRUARY && isleap(year)) in smb_gmtime_r()
232 tsec -= sec_per_month; in smb_gmtime_r()
235 result->tm_mon = month; in smb_gmtime_r()
236 result->tm_mday = (tsec / SECSPERDAY) + 1; in smb_gmtime_r()
238 result->tm_sec = tsec % 60; in smb_gmtime_r()
240 result->tm_min = tsec % 60; in smb_gmtime_r()
242 result->tm_hour = (int)tsec; in smb_gmtime_r()
251 * Converts the broken-down time in tm to a time value, i.e. the number
269 int year; in smb_timegm() local
272 return (-1); in smb_timegm()
274 year = tm->tm_year + TM_YEAR_BASE; in smb_timegm()
277 for (yy = EPOCH_YEAR; yy < year; ++yy) { in smb_timegm()
284 for (mm = TM_JANUARY; mm < tm->tm_mon; ++mm) { in smb_timegm()
287 if (mm == TM_FEBRUARY && isleap(year)) in smb_timegm()
293 tsec += (tm->tm_mday - 1) * SECSPERDAY; in smb_timegm()
294 tsec += tm->tm_sec; in smb_timegm()
295 tsec += tm->tm_min * SECSPERMIN; in smb_timegm()
296 tsec += tm->tm_hour * SECSPERHOUR; in smb_timegm()
298 tm->tm_isdst = 0; in smb_timegm()