Skip to content

tryparse throws an InexactError in millisecond DateFormat  #44003

@bachdavi

Description

@bachdavi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions