From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2213 Path: news.gmane.org!not-for-mail From: Yoran Heling Newsgroups: gmane.linux.lib.musl.general Subject: Re: localtime() isn't local Date: Fri, 26 Oct 2012 10:34:06 +0200 Message-ID: <20121026083405.GE16801@mahoro.ispfabriek.nl> References: <20121026075736.GD16801@mahoro.ispfabriek.nl> <20121026081507.GF24157@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1351240457 6173 80.91.229.3 (26 Oct 2012 08:34:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 08:34:17 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2214-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 26 10:34:25 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TRfN3-00030i-I4 for gllmg-musl@plane.gmane.org; Fri, 26 Oct 2012 10:34:25 +0200 Original-Received: (qmail 16350 invoked by uid 550); 26 Oct 2012 08:34:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 16341 invoked from network); 26 Oct 2012 08:34:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=yorhel.nl; s=mahoro; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=KiwKFvB8CtqsTPY1AEfaIumnPj6vzch9bMvcYppDl0w=; b=y1WPJmHVeVESinyMo751BZM3zND9KNx0QQaT/Uk7j94d2A4ZTBCoHk/nf/GbzUKQ2LKOCc4xbYvnsFOyMaicftKbscA98J/KAreD98CAK2DXHcTdrv454lkWo0Wx6e+F; Content-Disposition: inline In-Reply-To: <20121026081507.GF24157@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2213 Archived-At: On 2012-10-26, Szabolcs Nagy wrote: > * Yoran Heling [2012-10-26 09:57:37 +0200]: > > $ musl-gcc localtime.c -o localtime-musl > > $ gcc localtime.c -o localtime-glibc > > $ ./localtime-musl > > Local: 07:53:47 > > Global: 07:53:47 > > $ ./localtime-glibc > > Local: 09:53:50 > > Global: 07:53:50 > > $ date > > Fri Oct 26 09:53:51 CEST 2012 > > > > what is the TZ environment variable? > > that's the only method localtime (and tzset) > should support in posix to determine the timezone > > you may want to try > > TZ=CEST ./localtime-musl Ah, I didn't realize that the use of /etc/localtime wasn't part of POSIX. I don't have a TZ variable set, so that explains the output. TZ=CEST didn't work, but TZ=CEST-2 did the trick. This is quite a bummer, though. I use musl to create static binaries for Linux, and every glibc-based distribution (i.e. the vast majority) uses /etc/localtime rather than the TZ variable. :-( Thanks for the clarification. Yoran