libc/localtime: fix timegm return error when tz with isdst
testcase: set TZ CEST time_t t = time(NULL); struct tm *ts = localtime(&t); t = timegm(ts); t will return (time_t)-1; Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
1b9ed5725b
commit
7b2371f0ed
|
@ -2584,5 +2584,10 @@ time_t mktime(FAR struct tm *tmp)
|
|||
|
||||
time_t timegm(FAR struct tm *tmp)
|
||||
{
|
||||
if (tmp != NULL)
|
||||
{
|
||||
tmp->tm_isdst = 0;
|
||||
}
|
||||
|
||||
return time1(tmp, gmtsub, 0L);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue