Skip to content

as_datetime("2017-01-20") returns NA, breaks compatibility #597

Description

@mmitkevich

Hi, latest as_datetime doesn't parse ISO time string any more.

> lubridate::as_datetime("2017-01-20")
[1] NA
Warning message:
All formats failed to parse. No formats found. 

I had to insert old implementation

setMethod("as_datetime", "character",
          function(x, tz = "UTC") {
            with_tz(as.POSIXct(x), tzone = tz)
          })

into my code to revert to old semantics. It breaked my code.

Why shouldn't as_datetime parse dates without time as midnights?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions