dateparser icon indicating copy to clipboard operation
dateparser copied to clipboard

Date Parsing Rpoblem

Open hAzUpL8 opened this issue 3 years ago • 2 comments

Hi, In Slovenia date format is "d. M. yyyy" (Example: "13. 4. 2022") and the problem is that this dateParser can't parse it:

Exception in thread "main" java.time.format.DateTimeParseException: Text 12. 4. 2022 cannot parse at 0 at com.github.sisyphsu.dateparser.DateParser.error(DateParser.java:401) at com.github.sisyphsu.dateparser.DateParser.error(DateParser.java:397) at com.github.sisyphsu.dateparser.DateParser.parse(DateParser.java:131) at com.github.sisyphsu.dateparser.DateParser.parseDate(DateParser.java:67) at com.github.sisyphsu.dateparser.DateParserUtils.parseDate(DateParserUtils.java:29) at si.zzi.eforms.wp.utils.DateJSFConverter.main(DateJSFConverter.java:51)

Can you help? regards

hAzUpL8 avatar Apr 04 '22 08:04 hAzUpL8

It looks like Slovenia data format is d.M.yyyy but in your example you use similar format but with extra space "d. M. yyyy". Are you sure that this is official format with spaces? For me it looks like a custom format, so you have to use a custom parser for this (example: SimpleDateFormat) Without spaces it is parsed without error.

andriy-samson avatar Apr 04 '22 19:04 andriy-samson

Ok, I can do this with a custom parser, but unfortunately the official Slovenian date format is with extra spaces! [image: image.png] regards Haris

V V pon., 4. apr. 2022 ob 21:57 je oseba andriy-samson < @.***> napisala:

It looks like Slovenia data format is d.M.yyyy but in your example you use similar format but with extra space "d. M. yyyy". Are you sure that this is official format with spaces? For me it looks like a custom format, so you have to use a custom parser for this (example: SimpleDateFormat) Without spaces it is parsed without error.

— Reply to this email directly, view it on GitHub https://github.com/sisyphsu/dateparser/issues/26#issuecomment-1087954242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AICMDYRGQBVEMPWKVLQYIADVDNCTJANCNFSM5SOVIJUA . You are receiving this because you authored the thread.Message ID: @.***>

--

Lp. HarisŽujo

hAzUpL8 avatar Apr 05 '22 07:04 hAzUpL8