Skip to content

Add format argument to format.hms() #125

@retodomax

Description

@retodomax

There seems to be a format() S3 method for class 'hms'. However, it just returns the input as character. I would have expected that it takes the argument format and formats the output like an object of class POSIXct

library(hms)
t <- Sys.time()
format(t, "%H")
#> [1] "17"

t2 <- as_hms(t)
format(t2, "%H")
#> [1] "17:12:38.169816"

Created on 2024-11-05 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions