Author vstinner
Recipients Alexander.Belopolsky, Anders.Hovmöller, Arfrever, barry, belopolsky, berker.peksag, cvrebert, davydov, deronnax, eric.araujo, flying sheep, jcea, jstasiak, jwilk, karlcow, kirpit, martin.panter, mcepl, mihaic, nagle, pbryan, perey, piotr.dobrogost, r.david.murray, roysmith, vstinner
Date 2016-02-15.09:42:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwYmnkt89W-JFVQg+67JTOod3GNqVojPrRvNbCrza+RMXg@mail.gmail.com>
In-reply-to <CAKJVQ8_JpWgExWYCwdgUCjQ0cpOBZ+cAO8M3tUPRJu-tVJR7Hw@mail.gmail.com>
Content
> How does it parse this date:
> 2016-02-15T11:59:46.16588638674+09:00

Mathieu Dupuy added the comment:
> discarding the microseconds digits after the 6th.

Hum, you should use the same rounding method than
datetime.datetime.fromtimestamp(): ROUND_HALF_UP, as round().

In practice, you can for example pass a floating point number as
microseconds to datetime.datetime constructor.

Since datetime is implemented in C, I'm not sure that using the re is
the best choice. Since the regex looks simple enough, we may parse the
string without the re module. Well, maybe only for the C
implementation.

What is the behaviour is there are spaces before/after the string?
What if there are other characters like letters before/after? You
should add an unit test for that. I expect an error when parsing
"t=2012-04-23T09:15:00" for example.

Your regex ends with $ but doesn't start with ^. Using re.match(), ^
and $ are probably not needed, but I'm not confident when I use regex
:-)
History
Date User Action Args
2016-02-15 09:42:09vstinnersetrecipients: + vstinner, barry, jcea, roysmith, belopolsky, nagle, jwilk, mcepl, eric.araujo, Arfrever, r.david.murray, davydov, cvrebert, karlcow, Alexander.Belopolsky, perey, flying sheep, mihaic, berker.peksag, martin.panter, piotr.dobrogost, kirpit, Anders.Hovmöller, jstasiak, deronnax, pbryan
2016-02-15 09:42:09vstinnerlinkissue15873 messages
2016-02-15 09:42:09vstinnercreate