Author jamesh
Recipients
Date 2007-01-29.02:21:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The datetime.fromtimestamp() function works fine with integer timestamps and positive fractional timestamps, but fails if I pass a negative fractional timestamp.  For example:

>>> import datetime
>>> datetime.datetime.fromtimestamp(-1.05)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: microsecond must be in 0..999999

It should return the same result as datetime.fromtimestamp(-1) - timedelta(seconds=.5).

The same bug can be triggered in datetime.utcfromtimestamp().

I have been able to reproduce this bug in Python 2.4.4 and Python 2.5 on Linux.
History
Date User Action Args
2007-08-23 14:51:35adminlinkissue1646728 messages
2007-08-23 14:51:35admincreate