I\'m currently playing around a lot with dates and times for a package I\'m building.
Stumbling across this post reminded me again that it\'s generally not a bad ide
base has round.POSIXt to do this. Not sure why it doesn't come up with methods.
base
round.POSIXt
methods
x <- as.POSIXct(Sys.time()) x [1] "2012-07-04 10:01:08 BST" round(x,"mins") [1] "2012-07-04 10:01:00 BST" round(x,"hours") [1] "2012-07-04 10:00:00 BST" round(x,"days") [1] "2012-07-04"