Round or truncate date-time objects.
# S3 method for POSIXt
round(x,
units = c("secs", "mins", "hours", "days", "months", "years"))
# S3 method for POSIXt
trunc(x,
units = c("secs", "mins", "hours", "days", "months", "years"),
…)<p></p><p># S3 method for Date
round(x, …)
# S3 method for Date
trunc(x, …)</p>
| Parameter | Description |
|---|---|
x |
an object inheriting from "POSIXt" or "Date". |
units |
one of the units listed. Can be abbreviated. |
… |
arguments to be passed to or from other methods, notably digits for round. |
# NOT RUN {
round(.leap.seconds + 1000, "hour")
# }
# NOT RUN {
trunc(Sys.time(), "day")
# }