BF+ENH: added %m-%d-%Y pattern + do not add %Y for Feb 29 fix if already present in the pattern

although %m-%d-%Y is ambioius with %d-%m-%Y it comes after so it should not
be too dangerous (i.e. in upcoming days having smth like 02-01 should work as before matching
first one first) and proper fix to select between the two should follow some time
soon
This commit is contained in:
Yaroslav Halchenko 2012-01-28 12:35:39 -05:00
parent 10729f96b9
commit b257be4cd1
3 changed files with 21 additions and 4 deletions

View file

@ -117,6 +117,12 @@ class DateDetector:
template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}")
template.setPattern("%d-%m-%Y %H:%M:%S")
self.__templates.append(template)
# 01-27-2012 16:22:44.252
template = DateStrptime()
template.setName("Month-Day-Year Hour:Minute:Second[.Millisecond]")
template.setRegex("\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}")
template.setPattern("%m-%d-%Y %H:%M:%S")
self.__templates.append(template)
# TAI64N
template = DateTai64n()
template.setName("TAI64N")