Convert datetime object to character string

ic_char_datetime(x, zulu = FALSE)

Arguments

x

datetime object

zulu

is the datetime in Zulu time? FALSE by default, which means the calendar's current timezone is used.

Examples

x <- ic_datetime("20180809T160000")
ic_char_datetime(x) == "20180809T160000"
#> [1] TRUE
x <- ic_datetime("20180809T160000Z")
ic_char_datetime(x, zulu = TRUE) == "20180809T160000Z"
#> [1] TRUE
ic_char_date(as.Date("1985-12-26"))
#> [1] "19851226"