1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-28 01:20:57 +01:00

[utils] Add more date formats

This commit is contained in:
Sergey M․ 2017-01-12 22:39:45 +07:00
parent ed06da4e7b
commit cb655f34fb
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
2 changed files with 9 additions and 0 deletions

View File

@ -295,6 +295,9 @@ class TestUtil(unittest.TestCase):
self.assertEqual(unified_strdate('27.02.2016 17:30'), '20160227')
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)
self.assertEqual(unified_strdate('Feb 7, 2016 at 6:35 pm'), '20160207')
self.assertEqual(unified_strdate('July 15th, 2013'), '20130715')
self.assertEqual(unified_strdate('September 1st, 2013'), '20130901')
self.assertEqual(unified_strdate('Sep 2nd, 2013'), '20130902')
def test_unified_timestamps(self):
self.assertEqual(unified_timestamp('December 21, 2010'), 1292889600)

View File

@ -128,7 +128,13 @@ DATE_FORMATS = (
'%d %B %Y',
'%d %b %Y',
'%B %d %Y',
'%B %dst %Y',
'%B %dnd %Y',
'%B %dth %Y',
'%b %d %Y',
'%b %dst %Y',
'%b %dnd %Y',
'%b %dth %Y',
'%b %dst %Y %I:%M',
'%b %dnd %Y %I:%M',
'%b %dth %Y %I:%M',