__time_to_tm: initialize tm_zone and tm_gmtoff
[musl] / src / time / localtime.c
1 #include <time.h>
2
3 #include "__time.h"
4
5 struct tm *localtime(const time_t *t)
6 {
7         static struct tm tm;
8         __tzset();
9         __time_to_tm(*t - __timezone, &tm);
10         tm.tm_isdst = -1;
11         return __dst_adjust(&tm);
12 }