\Header{round.POSIXt}{Round / Truncate Data-Time Objects}
\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"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object inheriting from \code{"POSIXt"}.
\item[\code{units}] one of the units listed.  Can be abbreviated.
\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.\end{Details}
\begin{Value}
An object of class \code{"POSIXlt"}.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{DateTimeClasses}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
round(.leap.seconds + 1000, "hour")
trunc.POSIXt(Sys.time(), "day")
\end{ExampleCode}
\end{Examples}

