as_time: Convert to datetime

View source: R/temporal.R

as_timeR Documentation

Convert to datetime

Description

Convert to datetime

Usage

as_time(x, origin = as.POSIXct("1970-01-01", tz = "UTC"), tz = "UTC",
  format = NULL)

Arguments

x

Object to be converted.

origin

Date-time object, or something which can be coerced by as.POSIXct(tz = "GMT") to such an object.

tz

A time zone specification to be used for the conversion.

format

Character string giving a date-time format as used by strptime.

See Also

Other temporal functions: as_time_doy

Examples

x <- Sys.time()
x == as_time(as.numeric(x))
x <- 1:10
as_time(x)
x <- data.frame(t1 = 1:10, t2 = 1:10)
as_time(x)

columbia-glacier/cgr documentation built on Jan. 17, 2024, 2:42 p.m.