Author vstinner
Recipients Neil Muller, belopolsky, davidfraser, hodgestar, tebeka, vstinner, werneck
Date 2008-11-15.12:19:36
SpamBayes Score 3.12835e-05
Marked as misclassified No
Message-id <200811151318.34629.victor.stinner@haypocalc.com>
In-reply-to <d38f5330811141917n609f8affr634b1b31c6e8c7ff@mail.gmail.com>
Content
Le Saturday 15 November 2008 04:17:50 Alexander Belopolsky, vous avez écrit :
> it is really unnecessary because it can be
> written as epoch + timedelta(0, seconds, microseconds).

I tried yesterday and it doesn't work!

datetime.datetime(1970, 1, 1, 1, 0)
>>> t1 = epoch + timedelta(seconds=-1660000000)
>>> t2 = datetime.fromtimestamp(-1660000000)
>>> t2
datetime.datetime(1917, 5, 26, 1, 53, 20)
>>> t1 - t2
datetime.timedelta(0)
>>> t2 = datetime.fromtimestamp(-1670000000)
>>> t2
datetime.datetime(1917, 1, 30, 7, 6, 40)
>>> t1 = epoch + timedelta(seconds=-1670000000)
>>> t1 - t2
datetime.timedelta(0, 3600)

We lost an hour durint the 1st World War :-)

Whereas my implementation using mktime() works:

-1670000000.0
History
Date User Action Args
2008-11-15 12:19:38vstinnersetrecipients: + vstinner, tebeka, davidfraser, belopolsky, werneck, hodgestar, Neil Muller
2008-11-15 12:19:37vstinnerlinkissue2736 messages
2008-11-15 12:19:36vstinnercreate