Home | History | Annotate | Download | only in time

Lines Matching refs:tm

92 static char const *abbr(struct tm const *);
93 static intmax_t delta(struct tm *, struct tm *);
94 static void dumptime(struct tm const *);
97 static void showextrema(timezone_t, char *, time_t, struct tm *, time_t);
98 static void showtrans(char const *, struct tm const *, time_t, char const *,
179 static struct tm *
180 gmtime_r(time_t *tp, struct tm *tmp)
182 struct tm *r = gmtime(tp);
206 static struct tm *
207 localtime_r(time_t *tp, struct tm *tmp)
209 struct tm *r = localtime(tp);
220 static struct tm *
221 localtime_rz(ATTRIBUTE_MAYBE_UNUSED timezone_t rz, time_t *tp, struct tm *tmp)
230 mktime_z(timezone_t tz, struct tm *tmp)
333 static struct tm *
334 my_gmtime_r(time_t *tp, struct tm *tmp)
343 static struct tm *
344 my_localtime_rz(timezone_t tz, const time_t *tp, struct tm *tmp)
348 struct tm tm;
351 tm = *tmp;
352 t = mktime_z(tz, &tm);
407 saveabbr(char **buf, ptrdiff_t *bufalloc, struct tm const *tmp)
590 struct tm tm, newtm;
605 if (my_localtime_rz(tz, &t, &tm) == NULL
614 tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
616 ab = saveabbr(&abbrev, &abbrevsize, &tm);
618 showtrans("\nTZ=%f", &tm, t, ab, argv[i]);
619 showtrans("-\t-\t%Q", &tm, t, ab, argv[i]);
628 struct tm *newtmp = localtime_rz(tz, &newt, &newtm);
631 || (ab && (delta(&newtm, &tm) != newt - t
632 || newtm.tm_isdst != tm.tm_isdst
650 tm = newtm;
657 struct tm *tmp = my_localtime_rz(tz, &t, &tm);
727 struct tm lotm;
728 struct tm tm;
745 tm_ok = my_localtime_rz(tz, &t, &tm) != NULL;
748 || (ab && tm.tm_isdst == lotm.tm_isdst
749 && delta(&tm, &lotm) == t - lot
750 && strcmp(abbr(&tm), ab) == 0))) {
753 lotm = tm;
764 delta_nonneg(struct tm *newp, struct tm *oldp)
783 delta(struct tm *newp, struct tm *oldp)
794 adjusted_yday(struct tm const *a, struct tm const *b)
811 gmtoff(struct tm const *a, ATTRIBUTE_MAYBE_UNUSED time_t *t,
812 ATTRIBUTE_MAYBE_UNUSED struct tm const *b)
817 struct tm tm;
819 b = my_gmtime_r(t, &tm);
837 struct tm * tmp;
838 struct tm * gmtmp;
839 struct tm tm, gmtm;
853 tmp = my_localtime_rz(tz, &t, &tm);
880 showextrema(timezone_t tz, char *zone, time_t lo, struct tm *lotmp, time_t hi)
882 struct tm localtm[2], gmtm[2];
952 /* Store into BUF, of size SIZE, a formatted local time taken from *TM.
960 format_local_time(char *buf, ptrdiff_t size, struct tm const *tm)
962 int ss = tm->tm_sec, mm = tm->tm_min, hh = tm->tm_hour;
971 localtime *TM corresponding to time T. Use ISO 8601 format
983 format_utc_offset(char *buf, ptrdiff_t size, struct tm const *tm, time_t t)
985 long off = gmtoff(tm, &t, NULL);
988 && (*abbr(tm) == '-' || strcmp(abbr(tm), "zzz") == 0)))
1040 TM is the broken-down time, T the seconds count, AB the time zone
1055 struct tm const *tm, time_t t, char const *ab, char const *zone_name)
1075 formatted_len = strftime(b, s, f_prefix_copy, tm);
1089 formatted_len = format_local_time(b, s, tm);
1094 int offlen = format_utc_offset(b, s, tm, t);
1115 = (tm->tm_isdst
1116 ? snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
1132 showtrans(char const *time_fmt, struct tm const *tm, time_t t, char const *ab,
1135 if (!tm) {
1143 while (! istrftime(buf, size, time_fmt, tm, t, ab, zone_name)) {
1154 abbr(struct tm const *tmp)
1213 dumptime(const struct tm *timeptr)