1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-24 00:05:50 +01:00

[utils] Remove AM/PM from unified_strdate patterns

This commit is contained in:
Sergey M․ 2016-02-25 00:52:49 +06:00
parent 5c0a57185c
commit f160785c5c
2 changed files with 4 additions and 3 deletions

View File

@ -249,6 +249,7 @@ class TestUtil(unittest.TestCase):
self.assertEqual( self.assertEqual(
unified_strdate('2/2/2015 6:47:40 PM', day_first=False), unified_strdate('2/2/2015 6:47:40 PM', day_first=False),
'20150202') '20150202')
self.assertEqual(unified_strdate('Feb 14th 2016 5:45PM'), '20160214')
self.assertEqual(unified_strdate('25-09-2014'), '20140925') self.assertEqual(unified_strdate('25-09-2014'), '20140925')
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None) self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)

View File

@ -905,9 +905,9 @@ def unified_strdate(date_str, day_first=True):
'%d %b %Y', '%d %b %Y',
'%B %d %Y', '%B %d %Y',
'%b %d %Y', '%b %d %Y',
'%b %dst %Y %I:%M%p', '%b %dst %Y %I:%M',
'%b %dnd %Y %I:%M%p', '%b %dnd %Y %I:%M',
'%b %dth %Y %I:%M%p', '%b %dth %Y %I:%M',
'%Y %m %d', '%Y %m %d',
'%Y-%m-%d', '%Y-%m-%d',
'%Y/%m/%d', '%Y/%m/%d',