From: Jan Hudec <bulb@ucw.cz>
To: Junio C Hamano <gitster@pobox.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Peter Hartlich <wwsgj@hartlich.com>,
git@vger.kernel.org
Subject: Re: Wrong time in git-log when using right/ timezone
Date: Wed, 25 Jul 2007 22:03:44 +0200 [thread overview]
Message-ID: <20070725200344.GA3808@efreet.light.src> (raw)
In-Reply-To: <7vk5sx77me.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]
On Wed, Jul 18, 2007 at 13:57:13 -0700, Junio C Hamano wrote:
> No, I do not think the wackiness is from Germans.
>
> Using right/ perhaps without realizing the differences between
> TZ=right/Europe/Berlin and TZ=Europe/Berlin is probably the
> source of confusion.
>
> I do not offhand know what role "leap second adjustment" should
> play in the context of converting from Unix time we store in git
> commit objects to human readable role. As far as I understand,
> the returned timestamp from time(2), which we record in commit
> objects, is already "leap second adjusted".
I can attempt a brief explanation if anyone is (still) interested.
Leap seconds are added iregularly, because Earth rotation is slightly
irregular. Therefore some time calculations require lookup into a table of
leap seconds:
- If you include leap seconds in the timer, converting to date+time does,
while time difference does not. This is what the right/ timezones use.
- If you exclude leap seconds from the timer, time difference does, but
converting to date+time does not. This is what the normal timezones use.
Obviously, the two approaches don't play well together. POSIX chose the
later, likely because it's much more common to want to know date+time for
some moment, than to calculate several year long time interval with second
precision (because so far there have been at most 2 seconds difference per
year).
Note, that the former approach allows you to talk about time 65936023 seconds
from now, but not what date and time it will be, while the later allows you
to talk about 2437-11-05 16:12:05, but not how many seconds are left until
than.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-07-25 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-18 15:36 Wrong time in git-log when using right/ timezone Peter Hartlich
2007-07-18 16:04 ` Peter Hartlich
2007-07-18 17:01 ` Linus Torvalds
2007-07-18 17:55 ` Julian Phillips
2007-07-18 18:19 ` Linus Torvalds
2007-07-18 20:29 ` Alex Riesen
2007-07-18 20:57 ` Junio C Hamano
2007-07-25 20:03 ` Jan Hudec [this message]
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=20070725200344.GA3808@efreet.light.src \
--to=bulb@ucw.cz \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
--cc=wwsgj@hartlich.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.
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).