Home | History | Annotate | Download | only in mail

Lines Matching refs:tm

524  * Parse the 'Date:" field into a tm structure and return the gmtoff
528 date_to_tm(char *date, struct tm *tm)
566 struct tm tmp_tm;
570 * and copy the appropriate result to tm. This is not
578 tm->tm_wday = tmp_tm.tm_wday;
584 tm->tm_mday = tmp_tm.tm_mday;
585 tm->tm_mon = tmp_tm.tm_mon;
596 tm->tm_year = tmp_tm.tm_year;
602 tm->tm_hour = tmp_tm.tm_hour;
603 tm->tm_min = tmp_tm.tm_min;
608 tm->tm_sec = tmp_tm.tm_sec;
620 tm->tm_zone = get_comments(p);
622 tm->tm_zone = NULL;
630 * Parse the headline string into a tm structure. Returns a pointer
636 hl_date_to_tm(const char *buf, struct tm *tm)
653 struct tm tmp_tm; /* see comment in date_to_tm() */
660 tm->tm_wday = tmp_tm.tm_wday;
661 tm->tm_mday = tmp_tm.tm_mday;
662 tm->tm_mon = tmp_tm.tm_mon;
663 tm->tm_hour = tmp_tm.tm_hour;
664 tm->tm_min = tmp_tm.tm_min;
669 tm
678 tm->tm_zone = savestr(zone);
684 tm->tm_year = tmp_tm.tm_year; /* save this even if it failed */
691 * tm structure as much as possible.
697 dateof(struct tm *tm, struct message *mp, int use_hl_date)
703 (void)memset(tm, 0, sizeof(*tm));
713 (void)localtime_r(&now, tm);
733 (gmtoff = date_to_tm(date, tm)) != NULL) {
737 struct tm save_tm;
749 tm->tm_isdst = -1; /* let timegm(3) determine tm_isdst */
750 save_tm = *tm; /* use this if we fail */
757 tm->tm_hour += hour;
758 tm->tm_min += min;
761 tm->tm_hour -= hour;
762 tm->tm_min -= min;
764 if ((otime = timegm(tm)) == (time_t)-1 ||
765 localtime_r(&otime, tm) == NULL) {
768 *tm = save_tm;
772 *tm = save_tm;
773 /* tm->tm_isdst = -1; */ /* Set above */
774 tm->tm_gmtoff = 0;
775 tm->tm_zone = NULL;
790 tm->tm_isdst = -1; /* let mktime(3) determine tm_isdst */
797 else if (hl_date_to_tm(hl.l_date, tm) == NULL ||
798 mktime(tm) == -1)
981 preformat(struct tm *tm, const char *oldfmt, struct message *mp, int use_hl_date)
997 dateof(tm, mp, use_hl_date);
1005 fp = subformat(&p, mp, addr, user, subj, tm->tm_isdst);
1036 struct tm tm;
1050 newfmt = preformat(&tm, fmtstr, mp, use_hl_date);
1051 (void)strftime(buf, bufsize, newfmt, &tm);