Skip to content

Inconsistent date parsing when year is 2- or 4-digits and order "mdy"  #556

Description

@malwinare

Hi all,

For dates with mixed 2- and 4-digit year, the date-parsing behavior of parse_date_time() is inconsistent when orders = "mdy". But, it works fine when, for example, order = "ymd".

Examples

parse_date_time("apr.12.50", orders = "mdy")   # "2050-04-12" 

# inconsistent
parse_date_time(c("apr.12.50","apr.2.2016"), orders = "mdy")  #  "0050-04-12"  "2016-04-02"

# works fine:
parse_date_time(c("50.apr.12","2016.apr.2"), orders = "ymd")  # "2050-04-12" "2016-04-02"

R version: 3.4.0
lubridate: lubridate_1.6.0.9009

Thanks in advance.
Best,
Malwina

Activity

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

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions