Convert an epoch in milliseconds into a date

EpochMilli2Date(x, timezone = "GMT")

Arguments

x

A character or a numeric representing an epoch in milliseconds

timezone

A character with the time zone used for the conversion

Value

A POSIXct, the date corresponding to the epoch

Examples

epoch <- Date2EpochMilli(as.numeric(Sys.time()))
EpochMilli2Date(epoch)
#> [1] "2022-01-21 10:53:59 GMT"