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: Sun, 3 Apr 2016 12:43:40 +0600	[thread overview]
Message-ID: <CAP_d_8X-YUgS0BCE1o=JxxK4CX-H50f71LLF9X8FH6zx8+vtKA@mail.gmail.com> (raw)
In-Reply-To: <87shz3cjbo.fsf@web.de>

On Sun, Apr 3, 2016 at 12:11 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:

> I'm using git to make a backup of the file I'm working with after every
> save.  I want to display the age of the last backup made in the
> mode-line.

[…snipped…]

Your method looks sane to me, although the mention of TZ and mktime
regarding %s bother me a bit.

> The problem: since we have Daylight saving time, this always shows one
> hour less than the expected value (directly after saving it shows
> -0:59h).  This makes no sense to me, since I only work with "seconds
> since Epoch" absolute time values that I thought would not depend on the
> local time zone.  So either git or Emacs seems to make an error.

Let’s determine which.

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.
6. By the way, which OS are you on?



  reply	other threads:[~2016-04-03  6:43 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 [this message]
2016-04-13 16:14   ` Michael Heerdegen
2016-04-13 16:48     ` Yuri Khan
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_8X-YUgS0BCE1o=JxxK4CX-H50f71LLF9X8FH6zx8+vtKA@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.