Converts a POSIXct datetime to Unix timestamp
to_unix_timestamp(datetime, tz = "UTC")
datetime | Either a |
---|---|
tz | Character value corresponding to the timezone of |
A character value that corresponds to a Unix timestamp.
All Unix timestamps returned by this function have a millisecond-level precision.
dt <- "2019-01-01 00:00:10" to_unix_timestamp(datetime = dt, tz = "UTC")#> [1] "1546300810000"