araddon / dateparse

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

Date format of DD.MM.YYYY HH:MM:SS not supported #129

Open krisavi opened 3 years ago

krisavi commented 3 years ago

Tried also with dateparse.RetryAmbiguousDateWithSwap(true) option. Using Debugger it is visible it switches the flag, but it still finds the month to be out of range. Seems like it does not try to parse it with correct format still.

From the parser object it is visible it still has dayi and daylen set to cover 4th and 5th char and moi and molen to cover first and second char which is wrong.

parsing time "15.07.2021 05:37:00": month out of range

As also stated https://github.com/araddon/dateparse/issues/91 then the majority of locales using dot notation are either DD.MM.YYYY or YYYY.MM.DD

mehanizm commented 3 years ago

Hi, @krisavi I've fixed that in the PR https://github.com/araddon/dateparse/pull/133

You can use my fork while it is waiting for a merge go get github.com/mehanizm/dateparse@f82c8742c9f8

krisavi commented 2 years ago

For me I ended up rewriting the part that was supposed to use dateparse to accept Go date format as guideline for parsing dates.

alhamsya commented 1 year ago

@mehanizm why you fork the repo ? maybe better create PR to fix it.