Parse ISO8601 datetime format with UTC offset

I can get transform it to a POSIXct vaue like this.

library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#> 
#>     date
DateTime <- ymd_hms("2019-09-17T01:00:00+02:00", tz = "CET")
#> Date in ISO8601 format; converting timezone from UTC to "CET".
DateTime
#> [1] "2019-09-17 01:00:00 CEST"

Created on 2019-09-16 by the reprex package (v0.2.1)
I guessed the time zone you want to use. If you leave out the time zone, the returned value will be the UTC equivalent "2019-09-16 23:00:00 UTC"

3 Likes