Konvertieren Sie die DateTime von String R.

#Return "2021-01-20 20:11:59" in yyyy-mm-dd hh:mm:ss format.
ymd_hms("2021-01-20 20:11:59")

#> [1] "2021-01-20 20:11:59 UTC"

#Return "01/20/2021 08:01" in yyyy-mm-dd hh:mm format.
mdy_hm("01/20/2021 08:01")

#> [1] "2021-01-20 08:01:00 UTC"
Kwams