I am working with the following dataframe on this:
structure(list(id = 30042:30044, startTime = c("2016-03-13T00:00:00.000Z",
"2016-03-13T02:00:00.000Z", "2016-03-13T03:00:00.000Z")), row.names = 1022:1024, class = "data.frame")
> mydf
id startTime
1022 30042 2016-03-13T00:00:00.000Z
1023 30043 2016-03-13T02:00:00.000Z
1024 30044 2016-03-13T03:00:00.000Z
When i try to convert the startTime column from a character to a time, I get a weird NA appearing:
mydf <- mydf %>%
dplyr::mutate(startTime = as.POSIXct(startTime, format = '%Y-%m-%dT%H:%M:%S'))
> mydf
id startTime
1 30042 2016-03-13 00:00:00
2 30043 <NA>
3 30044 2016-03-13 03:00:00
I am quite lost as to why this is happening, have exhausted my debugging efforts and am simply confused because the format is the exact same for the 3 rows... any help is appreciated!
Edit - this appears to be a daylight savings time issue. What a pain in the ass....