Skip to content

tryparse throws an InexactError in millisecond DateFormat  #44003

@bachdavi

Description

@bachdavi
Contributor

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

Activity

added a commit that references this issue on Feb 3, 2022
c10dac1
added
backport 1.6Change should be backported to release-1.6
and removed
backport 1.6Change should be backported to release-1.6
on Feb 3, 2022
added 2 commits that reference this issue on Feb 15, 2022
462b7b4
7821e64
added a commit that references this issue on Feb 22, 2022
70812d8
added a commit that references this issue on Mar 8, 2022
8e3eade
added a commit that references this issue on Dec 23, 2022
9b9b310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @fredrikekre@bachdavi

      Issue actions

        `tryparse` throws an `InexactError` in millisecond `DateFormat` · Issue #44003 · JuliaLang/julia