The R Project SVN R

Rev

Rev 22644 | Rev 41241 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22644 Rev 28166
Line 1... Line 1...
1
\name{round.POSIXt}
1
\name{round.POSIXt}
2
\alias{round.POSIXt}
2
\alias{round.POSIXt}
3
\alias{trunc.POSIXt}
3
\alias{trunc.POSIXt}
-
 
4
\alias{round.Date}
-
 
5
\alias{trunc.Date}
4
\title{Round / Truncate Data-Time Objects}
6
\title{Round / Truncate Data-Time Objects}
5
\description{
7
\description{
6
  Round or truncate date-time objects.
8
  Round or truncate date-time objects.
7
}
9
}
8
\usage{
10
\usage{
9
\method{round}{POSIXt}(x, units=c("secs", "mins", "hours", "days"))
11
\method{round}{POSIXt}(x, units=c("secs", "mins", "hours", "days"))
10
\method{trunc}{POSIXt}(x, units=c("secs", "mins", "hours", "days"))
12
\method{trunc}{POSIXt}(x, units=c("secs", "mins", "hours", "days"))
-
 
13
 
-
 
14
\method{round}{Date}(x, \dots)
-
 
15
\method{trunc}{Date}(x)
11
}
16
}
12
\arguments{
17
\arguments{
13
  \item{x}{an object inheriting from \code{"POSIXt"}.}
18
  \item{x}{an object inheriting from \code{"POSIXt"} or \code{"Date"}.}
14
  \item{units}{one of the units listed.  Can be abbreviated.}
19
  \item{units}{one of the units listed.  Can be abbreviated.}
-
 
20
  \item{\dots}{arguments to be passed to or from other methods, notably
-
 
21
    \code{digits}.}
15
}
22
}
16
\details{
23
\details{
17
  The time is rounded or truncated to the second, minute, hour or day.
24
  The time is rounded or truncated to the second, minute, hour or day.
18
  Timezones are only relevant to days, when midnight in the current
25
  Timezones are only relevant to days, when midnight in the current
19
  timezone is used.
26
  timezone is used.
-
 
27
 
-
 
28
  The methods for class \code{"Date"} are of little use except to remove
-
 
29
  fractional days.
20
}
30
}
21
\value{
31
\value{
22
  An object of class \code{"POSIXlt"}.
32
  An object of class \code{"POSIXlt"}.
23
}
33
}
-
 
34
\seealso{
-
 
35
  \code{\link{round}} for the generic function and default methods.
-
 
36
  
24
\seealso{\code{\link{DateTimeClasses}}}
37
  \code{\link{DateTimeClasses}}, \code{\link{Date}}
-
 
38
}
25
 
39
 
26
\examples{
40
\examples{
27
round(.leap.seconds + 1000, "hour")
41
round(.leap.seconds + 1000, "hour")
28
trunc.POSIXt(Sys.time(), "day")
42
trunc(Sys.time(), "day")
29
}
43
}
30
\keyword{chron}
44
\keyword{chron}