parse_unix_time: Function to conveniently parse a vector of unix time to a...

Description Usage Arguments Value Author(s) Examples

View source: R/lubridate_supplements.R

Description

Function to conveniently parse a vector of unix time to a POSIXct date vector.

Usage

1
parse_unix_time(x, tz = "UTC", origin = "1970-01-01")

Arguments

x

An integer- or numeric-vector of unix times.

tz

Time-zone string. parse_unix_time defaults to "UTC".

origin

Origin of epoch. By definition, unix time is "1970-01-01", but other epochs are in use.

Value

A POSIXct vector with the length of x.

Author(s)

Stuart K. Grange

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

# A vector
unix_time_vector <- c(1460034000, 1460034703)

# Parse time, will be in UTC time-zone
parse_unix_time(unix_time_vector)

# Or in Berlin's time-zone
parse_unix_time(unix_time_vector, tz = "Europe/Berlin")


## End(Not run)

wacl-york/waclr documentation built on Dec. 7, 2018, 7:59 a.m.