diff --git a/main.py b/main.py new file mode 100644 index 000000000..30019dbf4 --- /dev/null +++ b/main.py @@ -0,0 +1,6 @@ +import dateparser + +# print(dateparser.parse('Fri Jan 26 16:32:21 +0000 2018', date_formats=['%a %b %d %H:%M:%S %z %Y'])) +# print(dateparser.parse(date_string="14 giu 13", date_formats=["%y %B %d"])) + +print(dateparser.parse(date_string="Mon, 25 Jun 2018 10:37:47 +0530 ")) diff --git a/tests/test_date.py b/tests/test_date.py index 335a5aa8b..ed50fff05 100644 --- a/tests/test_date.py +++ b/tests/test_date.py @@ -264,10 +264,11 @@ def test_should_parse_date(self, date_string, date_formats, expected_result): expected_result=datetime(2018, 1, 26, 16, 32, 21)), param(date_string='15/04/1904 14:05 +0004', date_formats=['%d/%m/%Y %H:%M %z'], expected_result=datetime(1904, 4, 15, 14, 5, tzinfo=timezone(timedelta(0, 240)))), - param(date_string='20-05-1994 23:00 GMT', date_formats=['%d-%m-%Y %H:%M %Z'], - expected_result=datetime( - 1994, 5, 20, 23, 0, tzinfo=StaticTzInfo('GMT', timedelta(seconds=0)) - )), + param( + date_string='20-05-1994 23:00 GMT', date_formats=['%d-%m-%Y %H:%M %Z'], expected_result=datetime( + 1994, 5, 20, 23, 0, tzinfo=StaticTzInfo('GMT', timedelta(seconds=0)) + ) + ), ]) def test_should_parse_localized_dates(self, date_string, date_formats, expected_result): self.when_date_is_parsed_with_formats(date_string, date_formats)