Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.POSIXct1970

as.POXIXct for number of seconds since the start of 1970.


Description

as.POSIXct.numeric requires origin to be specified. This assumes that it is the start of 1970.

Usage

as.POSIXct1970(x, tz="GMT", ...)

Arguments

x

a numeric vector of times in seconds since the start of 1970. (If x is not numeric, call as.POSIXct.)

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.

Details

o1970 <- strptime('1970-01-01', ' o1970. <- as.POSIXct(o1970), as.POSIXct(x, origin=o1970.)

Value

Returns a vector of class POSIXct.

Author(s)

Spencer Graves

See Also

Examples

sec <- c(0, 1, 60, 3600, 24*3600, 31*24*3600, 365*24*3600)
Sec <- as.POSIXct1970(sec)

all.equal(sec, as.numeric(Sec))

fda

Functional Data Analysis

v5.1.9
GPL (>= 2)
Authors
J. O. Ramsay <ramsay@psych.mcgill.ca> [aut,cre], Spencer Graves <spencer.graves@effectivedefense.org> [ctb], Giles Hooker <gjh27@cornell.edu> [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.