\Header{round.POSIXt}{Round / Truncate Data-Time Objects}
\alias{round.Date}{round.POSIXt}
\alias{trunc.Date}{round.POSIXt}
\alias{trunc.POSIXt}{round.POSIXt}
\keyword{chron}{round.POSIXt}
\begin{Description}\relax
Round or truncate date-time objects.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'POSIXt':
round(x, units=c("secs", "mins", "hours", "days"))
## S3 method for class 'POSIXt':
trunc(x, units=c("secs", "mins", "hours", "days"))

## S3 method for class 'Date':
round(x, ...)
## S3 method for class 'Date':
trunc(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object inheriting from \code{"POSIXt"} or \code{"Date"}.
\item[\code{units}] one of the units listed.  Can be abbreviated.
\item[\code{...}] arguments to be passed to or from other methods, notably
\code{digits}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The time is rounded or truncated to the second, minute, hour or day.
Timezones are only relevant to days, when midnight in the current
timezone is used.

The methods for class \code{"Date"} are of little use except to remove
fractional days.
\end{Details}
\begin{Value}
An object of class \code{"POSIXlt"}.
\end{Value}
\begin{SeeAlso}\relax
\code{\Link{round}} for the generic function and default methods.

\code{\Link{DateTimeClasses}}, \code{\Link{Date}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
round(.leap.seconds + 1000, "hour")
trunc(Sys.time(), "day")
\end{ExampleCode}
\end{Examples}

