Message352163
datetime.datetime.strptime throws out an error for me, to reproduce, use the following block:
```
>>> import datetime
>>> import pytz
>>> d2 = datetime.datetime(2019, 9, 11, 18, 35, 17, 334000, tzinfo=pytz.timezone('CET'))
>>> d2.strftime('%Y%m%d%H%M%S%f%Z')
'20190911183517334000CET'
>>> datetime.datetime.strptime('20190911183517334000CET', '%Y%m%d%H%M%S%f%Z')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/conda/envs/lab42/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/opt/conda/envs/lab42/lib/python3.6/_strptime.py", line 362, in _strptime
(data_string, format))
ValueError: time data '20190911183517334000CET' does not match format '%Y%m%d%H%M%S%f%Z'
>>> datetime.datetime.strptime('20190911183517334000', '%Y%m%d%H%M%S%f')
datetime.datetime(2019, 9, 11, 18, 35, 17, 334000)
```
so strptime could only handle the format without %Z. |
|
Date |
User |
Action |
Args |
2019-09-12 13:48:05 | Yixing Jiang | set | recipients:
+ Yixing Jiang |
2019-09-12 13:48:05 | Yixing Jiang | set | messageid: <1568296085.75.0.40792729081.issue38139@roundup.psfhosted.org> |
2019-09-12 13:48:05 | Yixing Jiang | link | issue38139 messages |
2019-09-12 13:48:05 | Yixing Jiang | create | |
|