all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: Time zone trouble without time zones being involved
Date: Wed, 13 Apr 2016 22:48:35 +0600	[thread overview]
Message-ID: <CAP_d_8UvnzC+FKNtpJfnG_vz==pT+Q3R=jpSz0faFBGsa9Nm+A@mail.gmail.com> (raw)
In-Reply-To: <87a8kxtris.fsf@web.de>

On Wed, Apr 13, 2016 at 10:14 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:

>> 1. Mark the current UTC time, both as a human-readable string and as a
>> unixtime value (e.g. on GNU, “date --utc --rfc-3339=seconds” and “date
>> +%s”, respectively).
>> 2. Make a commit.
>> 3. Execute the same command, “git log --pretty=format:%ad
>> --date=format:%s -n1”.
>> 4. Evaluate (current-time) and convert the first two elements of the
>> resulting 4-element list to unixtime.
>> 5. Check that the three unixtime values from steps 1, 3 and 4 are
>> reasonably close.
>
> I'm not sure how to do 4.  However, 1. and 3. already give me a
> difference of ~ 60*60.
>
> What does this tell us?

From what it looks like, either git or libc are misinformed about your
time zone.

I was hoping you’d post the actual values you see at each step. I
would then independently convert the unixtime into a date and time to
see they are sane. Your wall clock reading would be useful too.

(current-time) is documented thus in my copy of Emacs 24:

    Return the current time, as the number of seconds since 1970-01-01 00:00:00.
    The time is returned as a list of integers (HIGH LOW USEC PSEC).
    HIGH has the most significant bits of the seconds, while LOW has the
    least significant 16 bits.  USEC and PSEC are the microsecond and
    picosecond counts.

so you take the first element, multiply it by 65536, add the second element.

Example: I just now got this tuple: (22286 29507 190287 275000). 22286
* 65536 + 29507 = 1460564803. “date +%s” says 1460564877 so my Emacs
and the rest of my system agree and it took me just over a minute to
do the calculation.

>> 6. By the way, which OS are you on?
>
> uname -a => "Linux drachen 4.4.0-1-amd64 #1 SMP Debian 4.4.6-1
> (2016-03-17) x86_64 GNU/Linux".  Mostly Debian testing.

Good. What is your $TZ (if any), what does your /etc/timezone contain,
and is your tzdata package fresh enough?



  reply	other threads:[~2016-04-13 16:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-03  6:11 Time zone trouble without time zones being involved Michael Heerdegen
2016-04-03  6:43 ` Yuri Khan
2016-04-13 16:14   ` Michael Heerdegen
2016-04-13 16:48     ` Yuri Khan [this message]
2016-04-13 17:16       ` Michael Heerdegen
2016-04-13 17:40         ` Yuri Khan
2016-05-14 18:53           ` Michael Heerdegen
2016-05-14 21:51             ` Yuri Khan
2016-05-16 15:47               ` Michael Heerdegen
2016-05-16 16:06                 ` Yuri Khan
2016-05-17 14:57                   ` Michael Heerdegen
2016-05-17 15:31                     ` Yuri Khan
2016-05-17 16:19                       ` Michael Heerdegen

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='CAP_d_8UvnzC+FKNtpJfnG_vz==pT+Q3R=jpSz0faFBGsa9Nm+A@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.