I have a pretty basic question.
I have data formatted in this way:
2018-10-30 00:00:00 UTC
and need to convert it to be
2018-10-30
How do I do that?
I have a pretty basic question.
I have data formatted in this way:
2018-10-30 00:00:00 UTC
and need to convert it to be
2018-10-30
How do I do that?
Just use as.Date
, the format
you want is ISO 8601 that is default:
date <- "2018-10-30 00:00:00 UTC"
as.Date(date, tz = "UTC")
#> [1] "2018-10-30"
Created on 2022-01-15 by the reprex package (v2.0.1)