scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.57k stars 465 forks source link

Turkish Language Support - March #1098

Open BilgeDenizKocakk opened 2 years ago

BilgeDenizKocakk commented 2 years ago

The parser does not parse "Mart", the Turkish word for "March", correctly.

For example, 20 Mart 2001 is parsed as 2001-11-20 00:00:00-09:30, but it should be 2001-03-20 00:00:00.

As can be seen below, this issue does not persist with other months, and it is specific to Mart.

Screen Shot 2022-11-16 at 20 16 35

I believe the reason for this is MART - Marquesas Time.

Gallaecio commented 2 years ago

It works as expected if you indicate the input language:

>>> dateparser.parse("20 Mart 2001", languages=["tr"])
datetime.datetime(2001, 3, 20, 0, 0)

If you know the input language, you should always pass it to dateparser. If you do not, 20 Mart 2001 could be an ambiguous date.

Gallaecio commented 2 years ago

I am reopening in case we can be more smart about this specific scenario, but I consider this a minor issue.

BilgeDenizKocakk commented 2 years ago

Did not realize we could specify the language, just started using this library -- sorry. Thanks for your help!

gutsytechster commented 1 year ago

Could be related to this https://github.com/scrapinghub/dateparser/issues/1099.