Re: git.git object database at kernel.org?
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Apr 25, 2005, 18:46 UTC
- Message-ID
- <426D3B01.8060408@zytor.com>
- In-Reply-To
- <Pine.LNX.4.58.0504241553580.18901@ppc970.osdl.org>
Linus Torvalds wrote:
Show 7 quoted lines
> > 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.
-hpa