mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Mudd <johnbmudd@gmail.com>
To: musl <musl@lists.openwall.com>
Subject: Re: ctime, timezone?
Date: Thu, 1 May 2014 17:57:42 -0400	[thread overview]
Message-ID: <CAGDMk9G0i3-wYFxLJ_vYX+p1Fxpex-icdHOzVAGX6U9wM2qTYg@mail.gmail.com> (raw)
In-Reply-To: <CAGDMk9HMM9rCdMNhf1NbhYbBTmxWHU8HO4dkov7HLVwN6FPnhg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

$ 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 <johnbmudd@gmail.com> wrote:

> Am I doing something wrong? I expected roughly the same time when running
> the musl version.
>
>
> $ cat test_ctime.c
> #include <stdio.h>
> #include <time.h>
>
> 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
> $
>

[-- Attachment #2: Type: text/html, Size: 1672 bytes --]

  parent reply	other threads:[~2014-05-01 21:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 20:37 John Mudd
2014-05-01 20:56 ` Josiah Worcester
2014-05-01 21:57   ` Josiah Worcester
2014-05-01 21:57 ` John Mudd [this message]
2014-05-01 22:00   ` John Mudd
2014-05-01 22:18     ` Josiah Worcester
2014-05-02  5:06       ` Timo Teras
2014-05-02  5:10         ` Timo Teras
2014-05-01 22:47     ` Laurent Bercot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGDMk9G0i3-wYFxLJ_vYX+p1Fxpex-icdHOzVAGX6U9wM2qTYg@mail.gmail.com \
    --to=johnbmudd@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).