Skip to content

Date parsers are failing with dates which are in 24:00 format #418

@skgrange

Description

@skgrange

Hello lubridate team,
After the last update (version 1.5.6), the parse_date_time and ymd_h* functions fail to parse dates when the hour format includes the somewhat special case of 24 hours. The help file of the function still states that hours can take the form 0--24 and strftime performs as expected. An example:

library(lubridate)

# An example
date_string <- "2016-05-24 24:00:00"

# Both cases fail
ymd_hms(date_string, tz = "UTC")
parse_date_time(date_string, orders = "ymd hms", tz = "UTC")

# Works correctly, first instant of next day
strftime(date_string, tz = "UTC")

Is this a deliberate regression? Many thanks.

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