homepage

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 filip.zyzniewski
Recipients filip.zyzniewski
Date 2013年10月04日.11:00:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380884407.41.0.543045955431.issue19162@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013年10月04日 11:00:07filip.zyzniewskisetrecipients: + filip.zyzniewski
2013年10月04日 11:00:07filip.zyzniewskisetmessageid: <1380884407.41.0.543045955431.issue19162@psf.upfronthosting.co.za>
2013年10月04日 11:00:07filip.zyzniewskilinkissue19162 messages
2013年10月04日 11:00:06filip.zyzniewskicreate

AltStyle によって変換されたページ (->オリジナル) /