Skip to content

[R] Implement lubridate's parsers with year, month, and day, hour, minute, and second components #31774

Closed

Description

@asfimport

Parse date-times with year, month, and day, hour, minute, and second components:
ymd_hms() ymd_hm() ymd_h() dmy_hms() dmy_hm() dmy_h() mdy_hms() mdy_hm() mdy_h() ydm_hms() ydm_hm() ydm_h()

Reporter: Dragoș Moldovan-Grünfeld / @dragosmg
Assignee: Rok Mihevc / @rok

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-16395. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Jun 30, 2022

    @asfimport
    Author

    Dragoș Moldovan-Grünfeld / @dragosmg:
    Once the parse_date_time binding can deal with hours, minutes and seconds components, implementing these parsers could only involve an extension of the {}ymd_parser_map_factory{}.

    ymd_parser_map_factory <- function(order) {
    force(order)
    function(x, tz = NULL) {
    parse_x <- call_binding("parse_date_time", x, order, tz)
    if (is.null(tz)) {
    # we cast so we can mimic the behaviour of the `tz` argument in lubridate
    # "If NULL (default), a Date object is returned. Otherwise a POSIXct with
    # time zone attribute set to tz."
    parse_x <- parse_x$cast(date32())
    }
    parse_x
    }
    }
    for (ymd_order in ymd_parser_vec) {
    register_binding(ymd_order, ymd_parser_map_factory(ymd_order))
    }

  2. asfimport commented on Jul 22, 2022

    @asfimport
    Author

    Dewey Dunnington / @paleolimbot:
    Issue resolved by pull request 13627
    #13627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions