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

tryparse throws an InexactError in millisecond DateFormat #44003

Closed
bachdavi opened this issue Feb 1, 2022 · 0 comments · Fixed by #44004
Closed

tryparse throws an InexactError in millisecond DateFormat #44003

bachdavi opened this issue Feb 1, 2022 · 0 comments · Fixed by #44004

Comments

@bachdavi
Copy link
Contributor

bachdavi commented Feb 1, 2022

When using the date format "s" ,tryparse throws an InexactError in the case the input is not parsable as milliseconds. The throw InexactError was introduced in #22198 following issue #22100. I suppose we could simply return nothing instead of throwing here? 🙂

r == 0 || throw(InexactError(:convert, Decimal3, ms0))

Example:

using Dates; tryparse(Date, "2018-01-01", DateFormat("s"))

I created a PR for this change: #44004

@fredrikekre fredrikekre added backport 1.6 Change should be backported to release-1.6 backport 1.7 and removed backport 1.6 Change should be backported to release-1.6 backport 1.7 labels Feb 3, 2022
KristofferC pushed a commit that referenced this issue Feb 15, 2022
KristofferC pushed a commit that referenced this issue Feb 19, 2022
staticfloat pushed a commit that referenced this issue Dec 23, 2022
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

Successfully merging a pull request may close this issue.

2 participants