This function allows to convert epoch timestamp in seconds to an epoch in milliseconds

Date2EpochMilli(ts)

# S3 method for POSIXt
Date2EpochMilli(ts)

# S3 method for numeric
Date2EpochMilli(ts)

Arguments

ts

a numeric representing an epoch in seconds or a POSIXt date

Value

a character of the epoch in milliseconds

Examples

Date2EpochMilli(as.numeric(Sys.time()))
#> [1] "1642762438000"