summaryrefslogtreecommitdiffstats
path: root/Lib/datetime.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-08 00:13:34 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2011-01-08 00:13:34 (GMT)
commitb8bb4664fc8cb833f0fd50c9dac4f6c3be032784 (patch)
tree1b02d0fbb69e4849a2f4e0c48d7f33fa088b0bd0 /Lib/datetime.py
parent9253214fd9fe22b8b2b4ca5bb28952df8cab3e8c (diff)
downloadcpython-b8bb4664fc8cb833f0fd50c9dac4f6c3be032784.zip
cpython-b8bb4664fc8cb833f0fd50c9dac4f6c3be032784.tar.gz
cpython-b8bb4664fc8cb833f0fd50c9dac4f6c3be032784.tar.bz2
Issue #1777412: extended year range of strftime down to 1000.
Diffstat (limited to 'Lib/datetime.py')
-rw-r--r--Lib/datetime.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 29ffe24..47e54ec 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -173,9 +173,9 @@ def _format_time(hh, mm, ss, us):
# Correctly substitute for %z and %Z escapes in strftime formats.
def _wrap_strftime(object, format, timetuple):
year = timetuple[0]
- if year < 1900:
- raise ValueError("year=%d is before 1900; the datetime strftime() "
- "methods require year >= 1900" % year)
+ if year < 1000:
+ raise ValueError("year=%d is before 1000; the datetime strftime() "
+ "methods require year >= 1000" % year)
# Don't call utcoffset() or tzname() unless actually needed.
freplace = None # the string to use for %f
zreplace = None # the string to use for %z
@@ -1189,7 +1189,7 @@ class time:
"""Format using strftime(). The date part of the timestamp passed
to underlying strftime should not be used.
"""
- # The year must be >= 1900 else Python's strftime implementation
+ # The year must be >= 1000 else Python's strftime implementation
# can raise a bogus exception.
timetuple = (1900, 1, 1,
self._hour, self._minute, self._second,