From f160785c5c5a99a2fdc4724f1f66f423cf8f6bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Thu, 25 Feb 2016 00:52:49 +0600 Subject: [PATCH] [utils] Remove AM/PM from unified_strdate patterns --- test/test_utils.py | 1 + youtube_dl/utils.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_utils.py b/test/test_utils.py index e6887be9f..d0736f435 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -249,6 +249,7 @@ def test_unified_dates(self): self.assertEqual( unified_strdate('2/2/2015 6:47:40 PM', day_first=False), '20150202') + self.assertEqual(unified_strdate('Feb 14th 2016 5:45PM'), '20160214') self.assertEqual(unified_strdate('25-09-2014'), '20140925') self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 8ec70f93c..a3df90fad 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -905,9 +905,9 @@ def unified_strdate(date_str, day_first=True): '%d %b %Y', '%B %d %Y', '%b %d %Y', - '%b %dst %Y %I:%M%p', - '%b %dnd %Y %I:%M%p', - '%b %dth %Y %I:%M%p', + '%b %dst %Y %I:%M', + '%b %dnd %Y %I:%M', + '%b %dth %Y %I:%M', '%Y %m %d', '%Y-%m-%d', '%Y/%m/%d',