Search notes:

R package: lubridate

lubridate makes it easier to work with dates and time.

Convert seconds to hours and minutes

library(lubridate);

for (sec in seq(36300, 92000, by=7*60)) {
   sec_p <- seconds_to_period(sec);
   hr_mi <- sprintf('%02d:%02d', sec_p@hour, minute(sec_p));
   print(hr_mi);
}

ymd - mdy - dmy

library(lubridate)

dt_1 <- ymd('20170213')
dt_2 <- mdy('09282016')
dt_3 <- dmy('22032017')

dt_1
# [1] "2017-02-13 UTC"

dt_2
# [1] "2016-09-28 UTC"

dt_3
# [1] "2017-03-22 UTC"
Github repository about-r, path: /packages/lubridate/ymd-mdy-dmy.R

See also

R packages

Index