LibC: Make timegm() force tm_isdst to 0

UTC is not affected by summer time, and the BSD manpage for timegm()
says "The tm_isdst [...] members are forced to zero by timegm()."
This commit is contained in:
Nico Weber 2022-12-27 13:24:08 -05:00 committed by Brian Gianforcaro
parent 7aa9413b53
commit bb1f6f71f1
Notes: sideshowbarker 2024-07-17 03:19:14 +09:00

View file

@ -214,6 +214,7 @@ struct tm* localtime_r(time_t const* t, struct tm* tm)
time_t timegm(struct tm* tm)
{
tm->tm_isdst = 0;
return tm_to_time(tm, { __utc, __builtin_strlen(__utc) });
}