Subject: Re: git.git object database at kernel.org?

From: "H. Peter Anvin" <[email-masked]>
Date: Mon, 25 Apr 2005 12:05:44 -0700

H. Peter Anvin wrote:
> Linus Torvalds wrote:
> 
>>    NOTE! The fact that "mktime()" seems to depend on the timezone in 
>> which    it is made seems to make this questionable. I had always 
>> assumed that    mktime would take the timezone from the "struct tm", 
>> and thus be    reliable, but somebody seems to have shown that that is 
>> not the case at    all!
> 
> No, mktime() always uses the local time zone.  It's the inverse of 
> localtime().  If you know the timezone offset (e.g. if you have a RFC 
> 2822-style date) then you're probably better off rolling your own; 
> otherwise setenv("TZ"); tzset(); mktime(); is of course also doable.
> 

BTW, curl_getdate() from libcurl is a good multiformat date parser.

	-hpa