span <- new_interval(as.POSIXct("2009-01-01"), as.POSIXct("2010-02-02 01:01:01")) #interval
# [1] 2009-01-01 -- 2010-02-02 01:01:01
as.period(span)
# 1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second
Run the code above in your browser using DataLab