Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Parsing Rpoblem #26

Open
hAzUpL8 opened this issue Apr 4, 2022 · 2 comments
Open

Date Parsing Rpoblem #26

hAzUpL8 opened this issue Apr 4, 2022 · 2 comments

Comments

@hAzUpL8
Copy link

hAzUpL8 commented Apr 4, 2022

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

@andriy-samson
Copy link

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.

@hAzUpL8
Copy link
Author

hAzUpL8 commented Apr 5, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants