mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Fix julian day problem with strptime. Note: XXX about using 0, suggestions?
This commit is contained in:
parent
4c0db788e2
commit
490602d629
2 changed files with 15 additions and 1 deletions
|
|
@ -306,12 +306,14 @@ class TimeRE(dict):
|
|||
|
||||
def __init__(self, locale_time=LocaleTime()):
|
||||
"""Init inst with non-locale regexes and store LocaleTime object."""
|
||||
# XXX: should 0 be valid for:
|
||||
# day (d), julian day (j), month (m), and hour12 (I)?
|
||||
super(TimeRE,self).__init__({
|
||||
# The " \d" option is to make %c from ANSI C work
|
||||
'd': r"(?P<d>3[0-1]|[0-2]\d|\d| \d)",
|
||||
'H': r"(?P<H>2[0-3]|[0-1]\d|\d)",
|
||||
'I': r"(?P<I>0\d|1[0-2]|\d)",
|
||||
'j': r"(?P<j>(?:3[0-5]\d|6[0-6])|[0-2]\d\d|\d)",
|
||||
'j': r"(?P<j>(?:3[0-5]\d|36[0-6])|[0-2]\d\d|\d\d|\d)",
|
||||
'm': r"(?P<m>0\d|1[0-2]|\d)",
|
||||
'M': r"(?P<M>[0-5]\d|\d)",
|
||||
'S': r"(?P<S>6[0-1]|[0-5]\d|\d)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue