tidyverse / hms

A simple class for storing time-of-day values
https://hms.tidyverse.org/
Other
138 stars 25 forks source link

Alternate formatting options #14

Closed krlmlr closed 3 years ago

krlmlr commented 8 years ago

Via subclasses "dhms" and "ms" or others, see https://github.com/rstats-db/hms/issues/12#issuecomment-218591746.

krlmlr commented 7 years ago

Minutes and seconds are now formatted automatically if the hour is missing.

randomgambit commented 6 years ago

Hello @krlmlr , I think this is a related bug

> df %>% head()
# A tibble: 6 x 3
     X1 timestamp_utc dum
  <int> <chr>             <dbl>
1     0 16:00:00         0     
2     1 16:00:01         0     
3     2 16:00:02         0   

and now my beloved seconds disappear

df %>% head() %>%  mutate(timestamp_utc = as.hms(timestamp_utc))

# A tibble: 6 x 3
     X1 timestamp_utc dum
  <int> <time>            <dbl>
1     0 16:00            0     
2     1 16:00            0     
3     2 16:00            0     
4     3 16:00            0   

despite setting options(digits.secs=4) What is the issue here?

Thanks!

randomgambit commented 6 years ago

@krlmlr wrapping format() around the hms() call would output a character. so its not a solution either... Thanks!

krlmlr commented 5 years ago

Thanks. Could you please file a new issue?

krlmlr commented 3 years ago

Shelved for now.

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.