whapi_to_posixct: Convert numeric timestamp to POSIXct (UTC)
Description
Utility function to convert a Unix timestamp (seconds since 1970-01-01 UTC)
into a POSIXct object.
Uses lubridate::as_datetime() for readability and consistency with the
tidyverse ecosystem.
Usage
whapi_to_posixct(x)
Value
A POSIXct object (in UTC) or NA if x is NULL or NA.
Arguments
x
A numeric or character vector representing a Unix timestamp
(seconds since epoch). Can be NULL or NA.
# Single timestampwhapi_to_posixct(1756426418)
# Vector of timestamps (with NA)whapi_to_posixct(c(1756426418, NA))
# Character inputwhapi_to_posixct("1756426418")