Skip to content

round_date interprets secs > 60 in unexpecteed way #661

Description

@Holzhauer

Thanks a lot for the helpful package!

x <- lubridate::ymd_hms("2009-08-03 12:01:57.11")
lubridate::round_date(x, "2 mins")
[1] "2009-08-03 12:02:00 UTC"

but

lubridate::round_date(x, "120 secs")
[1] "2009-08-03 12:01:00 UTC"

This is dangerous when handling durations e.g. in seconds, only: when the durations exceeds a minute, the result is unexpected. In this case, at least a warning should be issued.

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