Writes a POSIXct as YYYY-MM-DDTHH:MM:SS[.fff]Z in UTC, or a Date as
YYYY-MM-DD. Years outside 0000 to 9999 are written in the ISO 8601
expanded form with a sign.
Value
A character vector, NA where x is NA, not finite, or
outside the calendar's range (a day count beyond the int32_t range,
about plus or minus 5.8 million years).
Examples
fast_format_datetime(as.POSIXct("2024-03-01 12:30:00.25", tz = "UTC"))
#> [1] "2024-03-01T12:30:00.250Z"
fast_format_datetime(Sys.time(), digits = 0)
#> [1] "2026-10-21T20:38:45Z"
fast_format_datetime(as.Date("2024-03-01"))
#> [1] "2024-03-01"