Lines Matching refs:tm
70 * generate a Time_t from tm + set
74 gen(register Tm_t* tm, register Set_t* set)
81 tm->tm_year = set->year;
84 if (set->year < 0 && set->mon < tm->tm_mon)
85 tm->tm_year++;
86 tm->tm_mon = set->mon;
88 tm->tm_mday = set->mday = 1;
94 tmweek(tm, set->weektype, set->week, set->wday);
102 tm->tm_mon = 0;
103 tm->tm_mday = set->yday + 1;
107 tm->tm_mday = set->mday;
110 if (set->hour < tm->tm_hour && set->yday < 0 && set->mday < 0 && set->wday < 0)
111 tm->tm_mday++;
112 tm->tm_hour = set->hour;
113 tm->tm_min = (set->min >= 0) ? set->min : 0;
114 tm->tm_sec = (set->sec >= 0) ? set->sec : 0;
118 tm->tm_min = set->min;
119 tm->tm_sec = (set->sec >= 0) ? set->sec : 0;
122 tm->tm_sec = set->sec;
124 tm->tm_nsec = set->nsec;
127 if (tm->tm_hour < 12)
128 tm->tm_hour += 12;
132 if (tm->tm_hour >= 12)
133 tm->tm_hour -= 12;
135 t = tmxtime(tm, set->zone);
139 tm = tmxtm(tm, t, tm->tm_zone);
140 tm->tm_mday += set->yday - tm->tm_yday;
145 tm = tmxtm(tm, t, tm->tm_zone);
146 if ((n = set->wday - tm->tm_wday) < 0)
148 tm->tm_mday += n;
157 tm = tmxtm(tm, t, tm->tm_zone);
159 tm->tm_nsec = set->nsec;
161 return z ? tmxtime(tm, set->zone) : t;
174 register Tm_t* tm;
194 tm = tmxtm(&ts, t, NiL);
251 set.year = (n - 19) * 100 + tm->tm_year % 100;
325 tm = tmxtm(tm, tmxsns(x, 0), tm->tm_zone);
395 x = gen(tm, &set);
437 t = gen(tm, &set);