ref: 351881313c73f9276a102d1508ca59e3cc8ad7b1
dir: /lib/c/localtime.c/
#include <time.h>
#include "libc.h"
#undef localtime
struct tm *
localtime(const time_t *timep)
{
struct tzone *tz;
struct tm *tm;
time_t t = *timep;
t += tz->gmtoff * 60;
t += tz->isdst * 60;
tm = gmtime(&t);
tz = _tzone(tm);
tm->tm_zone = tz->name;
tm->tm_isdst = tz->isdst;
tm->tm_gmtoff = tz->gmtoff;
return tm;
}