You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I need to work with date-times and want to split the data into a date and its time component, I feel frustrated because the existing tools I'm familiar with (lubridate, clock) make this task quite difficult. Perhaps I'm missing something.
I think hms could offer lightweight tools for splitting and recombining, e.g., hms_separate() and hms_unite() . The result of hms_separate() would be a three-column tibble with components:
date: Date
time: hms
tz: the "zone", "isdst" and "gmtoff" components from POSIXlt
This implementation would be oblivious of leap seconds and such, but instead aim at being "good enough" for most practical cases.
The experiment below demonstrates a roundtrip for this decomposition for a timespan of over four years, with at least one timepoint in each hour.
Whenever I need to work with date-times and want to split the data into a date and its time component, I feel frustrated because the existing tools I'm familiar with (lubridate, clock) make this task quite difficult. Perhaps I'm missing something.
I think hms could offer lightweight tools for splitting and recombining, e.g.,
hms_separate()
andhms_unite()
. The result ofhms_separate()
would be a three-column tibble with components:date
:Date
time
:hms
tz
: the "zone", "isdst" and "gmtoff" components fromPOSIXlt
This implementation would be oblivious of leap seconds and such, but instead aim at being "good enough" for most practical cases.
The experiment below demonstrates a roundtrip for this decomposition for a timespan of over four years, with at least one timepoint in each hour.
Created on 2023-01-30 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: