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: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Time zone trouble without time zones being involved
Date: Tue, 17 May 2016 21:31:21 +0600	[thread overview]
Message-ID: <CAP_d_8VCgx6hJp=Mz5ka--SPXspwgcqNXfyf5Gsfg8ia_9-4rA@mail.gmail.com> (raw)
In-Reply-To: <87posk68b7.fsf@web.de>

On Tue, May 17, 2016 at 8:57 PM, Michael Heerdegen
<michael_heerdegen@web.de> wrote:

> Hmm, I hoped I can do without a shell.
>
> Do you think the unixtime value as printed in
>
>   git log --pretty=format:%ad --date=raw -n1
>
> can be relied on?  Can I ignore the printed time zone delta?

In my limited testing, the timestamp seems to match the one in the commit.

The timestamp identifies the exact moment in universal time when the
commit was made. The time zone offset is only stored for the benefit
of tools which want to display commit times in their author and
committer’s time zones in effect at that moment (which might or might
not coincide with the user’s time zone offset in effect at the time of
viewing).

So yes, you can ignore the offset. But you still need something in
order to strip it off, either shell or string manipulation.

> [BTW, the doc of git-log tells that
>
>   --date=raw shows the date in the internal raw Git format %s %z format.
>
> but this seems to be a different %s because raw shows a different time]

I don’t even think any date arithmetic happens with --date=raw. The
information is already there in the commit data, in this exact format,
Git probably only extracts it with string operations.



  reply	other threads:[~2016-05-17 15:31 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
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 [this message]
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_8VCgx6hJp=Mz5ka--SPXspwgcqNXfyf5Gsfg8ia_9-4rA@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.