araddon / dateparse

GoLang Parse many date strings without knowing format in advance.
MIT License
2.03k stars 164 forks source link

Support eurodate format (dd-mmm-yy with a digit month) #139

Open dferstay opened 2 years ago

dferstay commented 2 years ago

We have support for dates of the form dd-mmm-yy where mmm is an alphanumeric literal; for example:

"15-Jan-2017"

However, there is a European date format that is similar where mmm is a digit; for example:

"15-01-2017"

The above fails to parse with:

Could not find format for "28-02-02"
twitchyliquid64 commented 2 years ago

What about teh sillyeh peoplez that put the month first? Its unambiguous if its the 13th day of the month, but otherwise what?

dferstay commented 2 years ago

What about teh sillyeh peoplez that put the month first? Its unambiguous if its the 13th day of the month, but otherwise what?

I'm thinking that this is the same as dd/mm/yyyy vs mm/dd/yyyy, which is discussed near the very top of the README.md

MM/DD/YYYY VS DD/MM/YYYY Right now this uses mm/dd/yyyy WHEN ambiguous if this is not desired behavior, use ParseStrict which will fail on ambiguous date strings.