I am pulling data from a sports API and I am receiving the following format for a startTime
column that I need to work with:
> dput(mydf)
structure(list(id = 29019:29023, startTime = c("2015-10-07T23:00:00.000Z",
"2015-10-08T00:00:00.000Z", "2015-10-08T02:00:00.000Z", "2015-10-08T02:30:00.000Z",
"2015-10-08T23:00:00.000Z")), row.names = c(NA, 5L), class = "data.frame")
> mydf
id startTime
1 29019 2015-10-07T23:00:00.000Z
2 29020 2015-10-08T00:00:00.000Z
3 29021 2015-10-08T02:00:00.000Z
4 29022 2015-10-08T02:30:00.000Z
5 29023 2015-10-08T23:00:00.000Z
> class(mydf$startTime)
"character"
I need to (a) convert this into a date-time type (not sure which type is best, i know there are a few date-time types in R), and then (b) adjust the time by 5 or 8 hours, since the times showing are GMT and I'd like either ET or PT times.
Any help with how to do this is greatly apprecaited!
Edit: Apparently this is a part of ISO-8601 date representation.