Message198941
The datetime class provides a min datetime object which is not formattable:
on Python 2:
$ python
Python 2.7.3 (default, Apr 10 2013, 05:13:16)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.min.strftime('%Y')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: year=1 is before 1900; the datetime strftime() methods require year >= 1900
>>>
and on Python 3:
$ python3
Python 3.2.3 (default, Apr 10 2013, 05:07:54)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.min.strftime('%Y')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: year=1 is before 1000; the datetime strftime() methods require year >= 1000
>>>
It seems to me that either datetime.datetime.min.year should be increased to 1900/1000 or strftime should be able to format year=1 - it is strange that the API doesn't support its own constants. |
|
Date |
User |
Action |
Args |
2013-10-04 11:00:07 | filip.zyzniewski | set | recipients:
+ filip.zyzniewski |
2013-10-04 11:00:07 | filip.zyzniewski | set | messageid: <1380884407.41.0.543045955431.issue19162@psf.upfronthosting.co.za> |
2013-10-04 11:00:07 | filip.zyzniewski | link | issue19162 messages |
2013-10-04 11:00:06 | filip.zyzniewski | create | |
|