Skip to content

Parsing a julian date fails when it's numeric and over 3 digits #1002

@rrohwer

Description

@rrohwer

When using parse_date_time(x = , orders = "j") it fails to parse if x is numeric and over 3 digits. It does parse correctly if x is numeric and 1 or 2 digits, and if x is character and 3 digits. Since the documentation says x can be numeric, I think this is a bug.

# these work:
parse_date_time(x = 1, orders = "j")
parse_date_time(x = 99, orders = "j")
parse_date_time(x = "100", orders = "j")

# this fails
parse_date_time(x = 100, orders = "j")
# [1] NA
# Warning message:
# All formats failed to parse. No formats found. 

Version notes from sessionInfo():
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

other attached packages:
[1] lubridate_1.8.0

Thanks for supporting this package, I rely on it! :)

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