This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients Arfrever, barry, belopolsky, lemburg, pitrou, thomir, veebers
Date 2014-10-15.00:17:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413332254.45.0.204596190618.issue22627@psf.upfronthosting.co.za>
In-reply-to
Content
In general, you cannot expect datetime.fromtimestamp(0) + timedelta(seconds) to return the same value as datetime.fromtimestamp(seconds).  This will only be true if you are lucky enough to live in an area where local government did not mess with timezones since 1970.  In your particular case, I think what is happening is that you have DST in January, but you did not have that on January 1, 1970.

$ zdump -v NZ | grep NZDT | head
NZ  Sat Nov  2 14:00:00 1974 UTC = Sun Nov  3 03:00:00 1974 NZDT isdst=1
NZ  Sat Feb 22 13:59:59 1975 UTC = Sun Feb 23 02:59:59 1975 NZDT isdst=1
NZ  Sat Oct 25 14:00:00 1975 UTC = Sun Oct 26 03:00:00 1975 NZDT isdst=1
NZ  Sat Mar  6 13:59:59 1976 UTC = Sun Mar  7 02:59:59 1976 NZDT isdst=1
NZ  Sat Oct 30 14:00:00 1976 UTC = Sun Oct 31 03:00:00 1976 NZDT isdst=1
NZ  Sat Mar  5 13:59:59 1977 UTC = Sun Mar  6 02:59:59 1977 NZDT isdst=1
NZ  Sat Oct 29 14:00:00 1977 UTC = Sun Oct 30 03:00:00 1977 NZDT isdst=1
NZ  Sat Mar  4 13:59:59 1978 UTC = Sun Mar  5 02:59:59 1978 NZDT isdst=1
NZ  Sat Oct 28 14:00:00 1978 UTC = Sun Oct 29 03:00:00 1978 NZDT isdst=1
NZ  Sat Mar  3 13:59:59 1979 UTC = Sun Mar  4 02:59:59 1979 NZDT isdst=1
History
Date User Action Args
2014-10-15 00:17:34belopolskysetrecipients: + belopolsky, lemburg, barry, pitrou, Arfrever, thomir, veebers
2014-10-15 00:17:34belopolskysetmessageid: <1413332254.45.0.204596190618.issue22627@psf.upfronthosting.co.za>
2014-10-15 00:17:34belopolskylinkissue22627 messages
2014-10-15 00:17:32belopolskycreate