Learn R Programming

whapi (version 0.0.2)

whapi_to_posix: Coerce to POSIXct (UTC) safely

Description

Converts a numeric timestamp (seconds since Unix epoch) into a POSIXct in UTC. Returns NA when input is NA.

Usage

whapi_to_posix(x)

Value

A POSIXct scalar or NA.

Arguments

x

Numeric scalar (seconds since "1970-01-01 00:00:00 UTC").

Examples

Run this code
whapi_to_posix(1756500000)
whapi_to_posix(NA)   # NA

Run the code above in your browser using DataLab