From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5020 Path: news.gmane.org!not-for-mail From: John Mudd Newsgroups: gmane.linux.lib.musl.general Subject: Re: ctime, timezone? Date: Thu, 1 May 2014 17:57:42 -0400 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013c61a053ee7704f85dc231 X-Trace: ger.gmane.org 1398981497 20692 80.91.229.3 (1 May 2014 21:58:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 1 May 2014 21:58:17 +0000 (UTC) To: musl Original-X-From: musl-return-5024-gllmg-musl=m.gmane.org@lists.openwall.com Thu May 01 23:58:14 2014 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 1Wfyze-0004Y1-Ih for gllmg-musl@plane.gmane.org; Thu, 01 May 2014 23:58:14 +0200 Original-Received: (qmail 1733 invoked by uid 550); 1 May 2014 21:58:14 -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 1725 invoked from network); 1 May 2014 21:58:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=thM6OD8ObGglS9zZWHpZhc7zBp4mYij1rzCkt6zK9Xo=; b=DxxdxU/Uq2Wo2e6w0voCrbn6v8ll8QZcqp86QnLSNcztkaJddk8snBMIl8YSHDil/E +1nmE07bEfr0XOtcbvorDrkCmn0UruVZ17px4FfJ7Gv41bJ56ldCj01bdo4GFjq/1oet uRMacfIjCXVrzN4aC1EB/2pZMOz4X9xFj5x6k+1uk27vshKFJsKktfffUfaihxzzwV3b 5Psde6uq9lR/J0zuvboXJh31GEBLAbAqIW+yNwmxpU2vE3f7o9XDMn1eQYQRwO+ejDsk iOcyl/OZaS2NH0O27eiu9Eug10fTujEADHoMG3o/Gm9AIgdD180VQVrnDqxrg9YGq3sZ ufLQ== X-Received: by 10.152.2.225 with SMTP id 1mr3173942lax.37.1398981482767; Thu, 01 May 2014 14:58:02 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:5020 Archived-At: --089e013c61a053ee7704f85dc231 Content-Type: text/plain; charset=ISO-8859-1 $ echo $TZ $ set | grep TZ $ I don't have $TZ set at all. $ ls -l /etc/localtime -rw-r--r-- 1 root root 3519 Apr 24 18:13 /etc/localtime $ Thanks, works as expected now with $TZ set. $ export TZ='America/New_York' $ test_ctime Thu May 1 17:54:29 2014 $ On Thu, May 1, 2014 at 4:37 PM, John Mudd wrote: > Am I doing something wrong? I expected roughly the same time when running > the musl version. > > > $ cat test_ctime.c > #include > #include > > int main() > { > time_t t = time(0); > printf("%s", ctime(&t)); > } > $ > > > $ gcc test_ctime.c -o test_ctime > $ test_ctime > Thu May 1 16:33:16 2014 > $ > > > $ musl-gcc -fno-stack-protector test_ctime.c -o test_ctime > $ test_ctime > Thu May 1 20:33:46 2014 > $ > --089e013c61a053ee7704f85dc231 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
$ echo $TZ

$ set | grep TZ
$
I don't have $TZ set at all.
$ ls -l /etc/localtime
-rw-r--r-- 1 root root 3519 Ap= r 24 18:13 /etc/localtime
$=A0


Thanks, works as expected= now with $TZ set.=A0

$ export TZ=3D'America/N= ew_York'
$ test_ctime=A0
Thu May =A01 17:54:29= 2014
$


=

On Thu, May 1, 2014 at 4:37 PM, John Mud= d <johnbmudd@gmail.com> wrote:
Am I doing something wrong?= I expected roughly the same time when running the musl version.


$ cat test_ctime.c=A0
#include <stdio= .h>
#include <time.h>

int main()
{
=A0 =A0 time_t t =3D t= ime(0);
=A0 =A0 printf("%s", ctime(&t));
= }
$=A0


$ gcc = =A0test_ctime.c =A0 -o test_ctime
$ test_ctime
Thu May =A01 16:33:16 2014
$=A0
=


$ musl-gcc -fno-stack-protect= or =A0 =A0test_ctime.c =A0 -o test_ctime
$ test_ctime
T= hu May =A01 20:33:46 2014
$

--089e013c61a053ee7704f85dc231--