tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
724 stars 207 forks source link

Set time units locale dependant in duration output #1130

Closed diegomsg closed 11 months ago

diegomsg commented 1 year ago

Is it possible to set time units output in as.duration related functions to get the nice formatting in -86169s (~-23.94 hours) to any language? Can't find anything on LC_TIME to include time units beyond days, months and AM/PM.

vspinu commented 11 months ago

I am afraid the localized formatting is rabbit hole and it will likely break international setups for people who already rely on the current formatting. You can pretty easily do it yourself by converting seconds to hours and format or just gsub hours to whatever language you need.