Learn R Programming

timefully (version 0.1.0)

date_to_timestamp: Convert date or datetime value to timestamp number

Description

Convert date or datetime value to timestamp number

Usage

date_to_timestamp(date, tzone = "Europe/Paris", milliseconds = TRUE)

Value

numeric

Arguments

date

date or datetime value

tzone

character, time-zone of the current time

milliseconds

logical, whether the timestamp is in milliseconds or seconds

Examples

Run this code
date_to_timestamp(as.Date("2024-01-01"))
date_to_timestamp(as.POSIXct("2024-01-01 08:00:00", tz = "UTC"), milliseconds = FALSE)

Run the code above in your browser using DataLab