View source: R/as.POSIXct1970.R
as.POSIXct1970 | R Documentation |
as.POXIXct
for number of seconds since the start of 1970.
as.POSIXct.numeric
requires origin to be specified. This assumes that
it is the start of 1970.
as.POSIXct1970(x, tz="GMT", ...)
x |
a numeric vector of times in seconds since the start of 1970. (If
|
tz |
A timezone specification to be used for the conversion, if one is required. System-specific (see time zones), but "" is the current timezone, and "GMT" is UTC (Universal Time, Coordinated). |
... |
optional arguments to pass to as.POSIXct. |
o1970 <- strptime('1970-01-01', ' o1970. <- as.POSIXct(o1970), as.POSIXct(x, origin=o1970.)
Returns a vector of class POSIXct
.
Spencer Graves
Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009), Functional data analysis with R and Matlab, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2005), Functional Data Analysis, 2nd ed., Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002), Applied Functional Data Analysis, Springer, New York.
as.POSIXct
,
ISOdate
,
strptime
sec <- c(0, 1, 60, 3600, 24*3600, 31*24*3600, 365*24*3600)
Sec <- as.POSIXct1970(sec)
all.equal(sec, as.numeric(Sec))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.