All pastes #236538 Raw Edit

Untitled

public text v1 · immutable
·published 2006-11-03 21:24 UTC
rendered paste body
#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);
}