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 petri.lehtinen
Recipients frankmillman, ghaering, petri.lehtinen, pitrou, python-dev, serhiy.storchaka, thiderman
Date 2013-02-24.08:33:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20130224083310.GA4439@chang>
In-reply-to <1361694164.59.0.684684903911.issue14720@psf.upfronthosting.co.za>
Content
Serhiy Storchaka wrote:
> convert_timestamp() can silently return wrong result if seconds
> saved with more than millisecond precision (i.e. '2012-04-04
> 15:06:00.000123456'). I propose or truncate fractional part to 6
> digits ('{:0<6.6}') or explicitly raise an exception if
> len(timepart_full[1]) > 6.

That's a good point. Also, '2012-04-04 15:06:00.1234567' fails with a
ValueError when executing the SELECT statement, because the
microsecond part is not in range 0-999999.

Truncating the fractional part to 6 characters sounds good to me,
because that way we get the best possible precision without failing
abruptly.
History
Date User Action Args
2013-02-24 08:33:13petri.lehtinensetrecipients: + petri.lehtinen, ghaering, pitrou, frankmillman, python-dev, serhiy.storchaka, thiderman
2013-02-24 08:33:13petri.lehtinenlinkissue14720 messages
2013-02-24 08:33:12petri.lehtinencreate