[issue2511] Commit timestamp in the future (probably timezone related)

Max Arnold bugs at mercurial.selenic.com
Sun Nov 21 09:24:33 UTC 2010


New submission from Max Arnold <lwarxx at gmail.com>:

My timezone is Asia/Novokuznetsk (introduced in 2010, more info here:
https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/540295). There are
steps to reproduce the problem:

$ hg init test
$ cd test
$ touch test.txt

$ LANG=C date
Sun Nov 21 15:08:21 NOVT 2010

$ hg ci -A -u User -m message
adding test.txt

$ hg log
changeset:   0:9a991cfb8f1c
tag:         tip
user:        User
date:        Sun Nov 21 16:08:49 2010 +0700
summary:     message

Note the commit date is in the future and off by hour. Expected: Sun Nov 21
15:08:49 2010 +0600. I

$ zdump -c 2009,2011 -v Asia/Novokuznetsk 
Asia/Novokuznetsk  Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 02:34:40 1901
NMT isdst=0
Asia/Novokuznetsk  Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 02:34:40 1901
NMT isdst=0
Asia/Novokuznetsk  Sat Mar 28 18:59:59 2009 UTC = Sun Mar 29 01:59:59 2009
KRAT isdst=0
Asia/Novokuznetsk  Sat Mar 28 19:00:00 2009 UTC = Sun Mar 29 03:00:00 2009
KRAST isdst=1
Asia/Novokuznetsk  Sat Oct 24 18:59:59 2009 UTC = Sun Oct 25 02:59:59 2009
KRAST isdst=1
Asia/Novokuznetsk  Sat Oct 24 19:00:00 2009 UTC = Sun Oct 25 02:00:00 2009
KRAT isdst=0
Asia/Novokuznetsk  Sat Mar 27 18:59:59 2010 UTC = Sun Mar 28 01:59:59 2010
KRAT isdst=0
Asia/Novokuznetsk  Sat Mar 27 19:00:00 2010 UTC = Sun Mar 28 02:00:00 2010
NOVST isdst=1
Asia/Novokuznetsk  Sat Oct 30 19:59:59 2010 UTC = Sun Oct 31 02:59:59 2010
NOVST isdst=1
Asia/Novokuznetsk  Sat Oct 30 20:00:00 2010 UTC = Sun Oct 31 02:00:00 2010
NOVT isdst=0
Asia/Novokuznetsk  Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 09:14:07 2038
NOVT isdst=0
Asia/Novokuznetsk  Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 09:14:07 2038
NOVT isdst=0

I can switch my timezone to Asia/Novosibirsk (it has the same offset from
UTC and same DST rules) and new commits will have proper timestamp. But this
timezone does not have proper history for my location (we moved from UTC+7
to UTC+6 in 2010), i.e. dates in the past will be incorrect:

$ zdump -c 2009,2011 -v Asia/Novosibirsk 
Asia/Novosibirsk  Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 02:17:32 1901
LMT isdst=0
Asia/Novosibirsk  Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 02:17:32 1901
LMT isdst=0
Asia/Novosibirsk  Sat Mar 28 19:59:59 2009 UTC = Sun Mar 29 01:59:59 2009
NOVT isdst=0
Asia/Novosibirsk  Sat Mar 28 20:00:00 2009 UTC = Sun Mar 29 03:00:00 2009
NOVST isdst=1
Asia/Novosibirsk  Sat Oct 24 19:59:59 2009 UTC = Sun Oct 25 02:59:59 2009
NOVST isdst=1
Asia/Novosibirsk  Sat Oct 24 20:00:00 2009 UTC = Sun Oct 25 02:00:00 2009
NOVT isdst=0
Asia/Novosibirsk  Sat Mar 27 19:59:59 2010 UTC = Sun Mar 28 01:59:59 2010
NOVT isdst=0
Asia/Novosibirsk  Sat Mar 27 20:00:00 2010 UTC = Sun Mar 28 03:00:00 2010
NOVST isdst=1
Asia/Novosibirsk  Sat Oct 30 19:59:59 2010 UTC = Sun Oct 31 02:59:59 2010
NOVST isdst=1
Asia/Novosibirsk  Sat Oct 30 20:00:00 2010 UTC = Sun Oct 31 02:00:00 2010
NOVT isdst=0
Asia/Novosibirsk  Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 09:14:07 2038
NOVT isdst=0
Asia/Novosibirsk  Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 09:14:07 2038
NOVT isdst=0

----------
messages: 14465
nosy: LwarX
priority: bug
status: unread
title: Commit timestamp in the future (probably timezone related)

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2511>
____________________________________________________


More information about the Mercurial-devel mailing list