Esri date fields are represented as milliseconds from the Unix Epoch.
Arguments
- x
an object of class
DateorPOSIXt. In the case ofis_date(), any R object.- tz
a character string. The time zone specification to be used for the conversion, if one is required. System-specific (see time zones), but
""is the current time zone, and"GMT"is UTC (Universal Time, Coordinated). Invalid values are most commonly treated as UTC, on some platforms with a warning.
Value
is_date()returns a logical scalardate_to_ms()returns a numeric vector of times in milliseconds from the Unix Epoch in the specified time zone.
Details
is_date(): checks if an object is aDateorPOSIXtclass object.date_to_ms()converts a date object to milliseconds from the Unix Epoch in the specified time zone.
Examples
today <- Sys.Date()
is_date(today)
#> [1] TRUE
date_to_ms(today)
#> [1] 1.761523e+12