New submission from Andreas Balogh:
Currently serializing datetime objects into isoformat string is well
possible. The reverse process - parsing an isoformat string into a
datetime object - doesn't work due to the missing %-tag for the strftime
format string.
Proposal:
Add new tag to str
Andreas Balogh <[EMAIL PROTECTED]> added the comment:
Yes, microsecond support is fine. Elaborating on my initial comment.
The following should assert:
a_datetime = datetime.now()
a_datetime.replace(microsecond = 1)
iso_str = adatetime.isoformat()
b_datetime = datetime.strptime(iso_str,
Andreas Balogh <[EMAIL PROTECTED]> added the comment:
Some typos corrected. Sorry for any inconvenience.
a_datetime = datetime.now()
a_datetime.replace(microsecond = 1)
iso_str = a_datetime.isoformat()
b_datetime = datetime.strptime(iso_str, "%Y-%m-%dT%H:%M:%S.%f")
a
Andreas Balogh added the comment:
- a_datetime.replace(microsecond = 1)
+ a_datetime = a_datetime.replace(microsecond = 1)
Thanks for spotting the bug.
--
___
Python tracker
<http://bugs.python.org/issue1
Andreas Balogh added the comment:
I encountered the same problem. It is unclear that using binary mode for the
file is solving the problem. I suggest to add a hint to the documentation.
--
nosy: +baloan
___
Python tracker
<http://bugs.python.