Lines Matching refs:timestruct

46 SysTime SysTimeFromTimeStruct(struct tm* timestruct, bool is_local) {  in SysTimeFromTimeStruct()  argument
49 return mktime64(timestruct); in SysTimeFromTimeStruct()
51 return timegm64(timestruct); in SysTimeFromTimeStruct()
54 void SysTimeToTimeStruct(SysTime t, struct tm* timestruct, bool is_local) { in SysTimeToTimeStruct() argument
57 localtime64_r(&t, timestruct); in SysTimeToTimeStruct()
59 gmtime64_r(&t, timestruct); in SysTimeToTimeStruct()
65 SysTime SysTimeFromTimeStruct(struct tm* timestruct, bool is_local) { in SysTimeFromTimeStruct() argument
68 return mktime(timestruct); in SysTimeFromTimeStruct()
70 return timegm(timestruct); in SysTimeFromTimeStruct()
73 void SysTimeToTimeStruct(SysTime t, struct tm* timestruct, bool is_local) { in SysTimeToTimeStruct() argument
76 localtime_r(&t, timestruct); in SysTimeToTimeStruct()
78 gmtime_r(&t, timestruct); in SysTimeToTimeStruct()
200 struct tm timestruct; in Explode() local
201 SysTimeToTimeStruct(seconds, &timestruct, is_local); in Explode()
203 exploded->year = timestruct.tm_year + 1900; in Explode()
204 exploded->month = timestruct.tm_mon + 1; in Explode()
205 exploded->day_of_week = timestruct.tm_wday; in Explode()
206 exploded->day_of_month = timestruct.tm_mday; in Explode()
207 exploded->hour = timestruct.tm_hour; in Explode()
208 exploded->minute = timestruct.tm_min; in Explode()
209 exploded->second = timestruct.tm_sec; in Explode()
215 struct tm timestruct; in FromExploded() local
216 timestruct.tm_sec = exploded.second; in FromExploded()
217 timestruct.tm_min = exploded.minute; in FromExploded()
218 timestruct.tm_hour = exploded.hour; in FromExploded()
219 timestruct.tm_mday = exploded.day_of_month; in FromExploded()
220 timestruct.tm_mon = exploded.month - 1; in FromExploded()
221 timestruct.tm_year = exploded.year - 1900; in FromExploded()
222 timestruct.tm_wday = exploded.day_of_week; // mktime/timegm ignore this in FromExploded()
223 timestruct.tm_yday = 0; // mktime/timegm ignore this in FromExploded()
224 timestruct.tm_isdst = -1; // attempt to figure it out in FromExploded()
226 timestruct.tm_gmtoff = 0; // not a POSIX field, so mktime/timegm ignore in FromExploded()
227 timestruct.tm_zone = NULL; // not a POSIX field, so mktime/timegm ignore in FromExploded()
240 struct tm timestruct0 = timestruct; in FromExploded()
242 seconds = SysTimeFromTimeStruct(&timestruct, is_local); in FromExploded()
246 timestruct = timestruct0; in FromExploded()
247 timestruct.tm_isdst = 0; in FromExploded()
248 int64_t seconds_isdst0 = SysTimeFromTimeStruct(&timestruct, is_local); in FromExploded()
250 timestruct = timestruct0; in FromExploded()
251 timestruct.tm_isdst = 1; in FromExploded()
252 int64_t seconds_isdst1 = SysTimeFromTimeStruct(&timestruct, is_local); in FromExploded()