\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}
round(x, units=c("secs", "mins", "hours", "days"))
trunc.POSIXt(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{Note}\relax
\code{trunc} is not generic, so \code{trunc.POSIXt} has to be called
explicitly.\end{Note}
\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}

