Skip to main content
Source Link
Lucas Morin
  • 3.3k
  • 5
  • 26
  • 53

First you need to split the string :

x = "2020-02-24T18:00:00 2020-02-25T18:00:00 2020-02-26T18:00:00"

x = strsplit(x, "\\s+")[[1]]

[1] "2020-02-24T18:00:00" "2020-02-25T18:00:00" "2020-02-26T18:00:00"

Then you can just the result as dates :

x = as.Date(x)
[1] "2020-02-24" "2020-02-25" "2020-02-26"