Lines Matching refs:tm
86 static int epoch_to_tm(const unsigned char **, struct tm *);
88 static char *_strptime(const char *, const char *, struct tm *, int);
94 strptime(const char *buf, const char *fmt, struct tm *tm) in strptime() argument
96 return(_strptime(buf, fmt, tm, 1)); in strptime()
101 _strptime(const char *buf, const char *fmt, struct tm *tm, int initialize) in _strptime() argument
161 if (!(bp = _strptime(bp, _ctloc(d_t_fmt), tm, 0))) in _strptime()
167 if (!(bp = _strptime(bp, "%m/%d/%y", tm, 0))) in _strptime()
173 if (!(bp = _strptime(bp, "%Y-%m-%d", tm, 0))) in _strptime()
179 if (!(bp = _strptime(bp, "%H:%M", tm, 0))) in _strptime()
185 if (!(bp = _strptime(bp, "%I:%M:%S %p", tm, 0))) in _strptime()
191 if (!(bp = _strptime(bp, "%H:%M:%S", tm, 0))) in _strptime()
197 if (!(bp = _strptime(bp, "%e-%b-%Y", tm, 0))) in _strptime()
203 if (!(bp = _strptime(bp, _ctloc(t_fmt), tm, 0))) in _strptime()
209 if (!(bp = _strptime(bp, _ctloc(d_fmt), tm, 0))) in _strptime()
235 tm->tm_wday = i; in _strptime()
260 tm->tm_mon = i; in _strptime()
279 if (!(_conv_num(&bp, &tm->tm_mday, 1, 31))) in _strptime()
289 if (!(_conv_num(&bp, &tm->tm_hour, 0, 23))) in _strptime()
298 if (!(_conv_num(&bp, &tm->tm_hour, 1, 12))) in _strptime()
304 if (!(_conv_num(&bp, &tm->tm_yday, 1, 366))) in _strptime()
306 tm->tm_yday--; in _strptime()
312 if (!(_conv_num(&bp, &tm->tm_min, 0, 59))) in _strptime()
318 if (!(_conv_num(&bp, &tm->tm_mon, 1, 12))) in _strptime()
320 tm->tm_mon--; in _strptime()
330 if (tm->tm_hour > 12) /* i.e., 13:00 AM ?! */ in _strptime()
332 else if (tm->tm_hour == 12) in _strptime()
333 tm->tm_hour = 0; in _strptime()
341 if (tm->tm_hour > 12) /* i.e., 13:00 PM ?! */ in _strptime()
343 else if (tm->tm_hour < 12) in _strptime()
344 tm->tm_hour += 12; in _strptime()
355 if (!(_conv_num(&bp, &tm->tm_sec, 0, 60))) in _strptime()
359 if (!(epoch_to_tm(&bp, tm))) in _strptime()
378 if (!(_conv_num(&bp, &tm->tm_wday, 0, 6))) in _strptime()
387 tm->tm_wday = i % 7; in _strptime()
417 tm->tm_year = i - TM_YEAR_BASE; in _strptime()
430 tm->tm_isdst = 0; in _strptime()
431 tm->tm_gmtoff = 0; in _strptime()
432 tm->tm_zone = gmt; in _strptime()
435 tm->tm_isdst = 0; in _strptime()
436 tm->tm_gmtoff = 0; in _strptime()
437 tm->tm_zone = utc; in _strptime()
446 tm->tm_isdst = i; in _strptime()
447 tm->tm_gmtoff = -(timezone); in _strptime()
448 tm->tm_zone = tzname[i]; in _strptime()
481 tm->tm_isdst = 0; in _strptime()
482 tm->tm_gmtoff = 0; in _strptime()
483 tm->tm_zone = utc; in _strptime()
495 tm->tm_gmtoff = (-5 - i) * SECSPERHOUR; in _strptime()
496 tm->tm_zone = (char *)nast[i]; in _strptime()
502 tm->tm_isdst = 1; in _strptime()
503 tm->tm_gmtoff = (-4 - i) * SECSPERHOUR; in _strptime()
504 tm->tm_zone = (char *)nadt[i]; in _strptime()
524 tm->tm_isdst = 0; /* XXX */ in _strptime()
525 tm->tm_gmtoff = offs; in _strptime()
526 tm->tm_zone = NULL; /* XXX */ in _strptime()
554 tm->tm_year = relyear + 2000 - TM_YEAR_BASE; in _strptime()
556 tm->tm_year = relyear + 1900 - TM_YEAR_BASE; in _strptime()
558 tm->tm_year = relyear + century - TM_YEAR_BASE; in _strptime()
565 const int year = tm->tm_year + TM_YEAR_BASE; in _strptime()
569 tm->tm_yday = tm->tm_mday - 1; in _strptime()
570 for (i = 0; i < tm->tm_mon; i++) in _strptime()
571 tm->tm_yday += mon_lens[i]; in _strptime()
575 int days = tm->tm_yday; in _strptime()
577 tm->tm_wday = EPOCH_WDAY + in _strptime()
582 tm->tm_yday; in _strptime()
583 tm->tm_wday %= DAYSPERWEEK; in _strptime()
584 if (tm->tm_wday < 0) in _strptime()
585 tm->tm_wday += DAYSPERWEEK; in _strptime()
588 tm->tm_mon = 0; in _strptime()
589 while (tm->tm_mon < MONSPERYEAR && days >= mon_lens[tm->tm_mon]) in _strptime()
590 days -= mon_lens[tm->tm_mon++]; in _strptime()
593 tm->tm_mday = days + 1; in _strptime()
625 epoch_to_tm(const unsigned char **buf, struct tm *tm) in epoch_to_tm() argument
639 if (localtime_r(&secs, tm) == NULL) in epoch_to_tm()