I'm using R. The data is coming from a SQL database, and it's being imported as a string/char. I'm trying to convert this string ("2021-05-19T19:30:00.000Z") into a datetime. There are multiples in the dataset like this, and some look normal (year-month-day i.e. 2021-05-17) which are easy to convert. It's just this format of the string I'm having difficulties with. I have tried the following which are the answers to similar questions on this site, but both return NAs.
test_string <- "2021-05-19T19:30:00.000Z"
converted_string <- as.POSIXct(test_string, format="%Y-%m-%dT%H:%M:%SZ")
And
converted_string <- lubridate::ymd_hm(test_string)
Furthermore, would it be possible to solve this using lubridate? I'm working on the cloud, and it is difficult for me to install new packages.