Untitled
public text v1 · immutable#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main(void)
{
struct tm tm;
setenv("TZ", "", 1);
tzset();
memset(&tm, 0, sizeof(tm));
tm.tm_sec = 0;
tm.tm_min = 0;
tm.tm_hour = 18;
tm.tm_mday = 3;
tm.tm_mon = 10;
tm.tm_year = 106;
tm.tm_yday = -1;
tm.tm_isdst = 0;
time_t ret = mktime(&tm);
printf("ret %ld\n", ret);
ret = timegm(&tm);
printf("ret %ld\n", ret);
}