bear / parsedatetime

Parse human-readable date/time strings
Apache License 2.0
695 stars 106 forks source link

Calendar.parse ignores time component if there is a : after date #235

Open codeforester opened 5 years ago

codeforester commented 5 years ago

If the date string has a ":" after the date, Calendar.parse ignores the time part in the date string and uses the current time instead. This seems like a bug.

Please see https://stackoverflow.com/q/56370097/6862601 for details.

If this is a bug, please fix. If not, please let me know the workaround.

bear commented 4 years ago

I don't think this is necessarily a bug as the date format

dd/mmmmm/yyyy:hh:mm:ss isn't a "normal" datetime format, but that's common in logs for sure This is one of the rare times when I would suggest not using parsedatetime as it is overkill for parsing known datetime structures from known points in a string - but i'm going to leave the issue as I may have a workaround