diff options
author | niemeyer <> | 2005-07-03 13:40:11 +0000 |
---|---|---|
committer | niemeyer <> | 2005-07-03 13:40:11 +0000 |
commit | 8bfedd8ac68bfb3618ea3fcf48ac7cfed9d85a36 (patch) | |
tree | 1f70270a070bd6499a1c4130bfa2f3359a87f374 | |
parent | 1d784c5f7f1c8b220bde5408695bdc5e39d6d0d5 (diff) | |
download | dateutil-8bfedd8ac68bfb3618ea3fcf48ac7cfed9d85a36.tar.gz |
Fixing parsing of XXhXXm formatted time after day/month/year
has been parsed.
-rw-r--r-- | dateutil/parser.py | 3 | ||||
-rw-r--r-- | test.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/dateutil/parser.py b/dateutil/parser.py index 60daa9f..5f25a4d 100644 --- a/dateutil/parser.py +++ b/dateutil/parser.py @@ -368,7 +368,8 @@ class parser: len_li = len(l[i]) i += 1 if (len(ymd) == 3 and len_li in (2, 4) - and (i >= len_l or l[i] != ':')): + and (i >= len_l or (l[i] != ':' and + info.hms(l[i]) is None))): # 19990101T23[59] s = l[i-1] res.hour = int(s[:2]) @@ -3350,6 +3350,10 @@ class ParserTest(unittest.TestCase): self.assertEqual(parse("01m02h", default=self.default), datetime(2003, 9, 25, 2, 1)) + def testRandomFormat35(self): + self.assertEqual(parse("2004 10 Apr 11h30m", default=self.default), + datetime(2004, 4, 10, 11, 30)) + def testIncreasingCTime(self): # This test will check 200 different years, every month, every day, # every hour, every minute, every second, and every weekday, using |