From a69801e2c6f53985acf475f391f7f7205775d631 Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Wed, 14 Jan 2015 00:16:34 +0200 Subject: [PATCH] [utils] Add additional format to unified_strdate --- test/test_utils.py | 1 + youtube_dl/utils.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/test_utils.py b/test/test_utils.py index 399cdfdbd..206760d99 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -148,6 +148,7 @@ class TestUtil(unittest.TestCase): self.assertEqual(unified_strdate('8/7/2009'), '20090708') self.assertEqual(unified_strdate('Dec 14, 2012'), '20121214') self.assertEqual(unified_strdate('2012/10/11 01:56:38 +0000'), '20121011') + self.assertEqual(unified_strdate('1968 12 10'), '19681210') self.assertEqual(unified_strdate('1968-12-10'), '19681210') self.assertEqual(unified_strdate('28/01/2014 21:00:00 +0100'), '20140128') self.assertEqual( diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 98732e8e9..38c18c127 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -721,6 +721,7 @@ def unified_strdate(date_str, day_first=True): '%b %dst %Y %I:%M%p', '%b %dnd %Y %I:%M%p', '%b %dth %Y %I:%M%p', + '%Y %m %d', '%Y-%m-%d', '%Y/%m/%d', '%Y/%m/%d %H:%M:%S',