api_to_date: Convert API Time Back to a Timestamp

Description Usage Arguments Value Examples

Description

This is a convenience function that wraps as.POSIXct to convert a time represented in seconds after the unit epoch to a more human interpretable timestamp.

Usage

1
api_to_date(api_date, tz = "")

Arguments

api_date

A date or vector of dates to be converted

tz

The timezone you want the resulting output to be in, defaults to system's timezone when calling this function directly.

Value

A POSIXct of the input

Examples

1
2
3
4
5
6
7
8
# capture the current time
right_now <- Sys.time()

# convert it to api format (seconds after unit epoch)
right_now_as_api <- date_to_api(right_now)

# and back to current time
api_to_date(right_now_as_api)

geoffwlamb/redditr documentation built on May 15, 2019, 11:41 a.m.