Skip to content

naive_time_parse() can fail when rounding up to 60 seconds #230

@DavisVaughan

Description

@DavisVaughan
library(clock)

# Round up to 60 seconds (looks invalid)? That causes the NA?
naive_time_parse("2021-04-16T22:35:59.955Z", format = "%Y-%m-%dT%H:%M:%6SZ", precision = "second")

# Rounds up to a valid 59 seconds
naive_time_parse("2021-04-16T22:35:58.955Z", format = "%Y-%m-%dT%H:%M:%6SZ", precision = "second")

# No rounding
naive_time_parse("2021-04-16T22:35:59.955Z", format = "%Y-%m-%dT%H:%M:%6SZ", precision = "millisecond")

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