dateparse icon indicating copy to clipboard operation
dateparse copied to clipboard

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

Open krisavi opened this issue 4 years ago • 3 comments

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

krisavi avatar Jul 15 '21 16:07 krisavi

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

mehanizm avatar Aug 09 '21 13:08 mehanizm

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

krisavi avatar Sep 24 '21 08:09 krisavi

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

alhamsya avatar Oct 22 '22 06:10 alhamsya