Convert text timestamps in a format according to ISO 8601 to POSIXct objects

isoToLocaltime(timestamps, dbg = TRUE)

Arguments

timestamps

vector of character timestamps of format yyyy-mm-dd HH:MM:SS+[01|02], i.e. ending either in '+0100' (UTC offset in Berlin in winter) or '+0200' (UTC offset in Berlin in summer)

dbg

if TRUE debug messages are shown

Examples

times <- isoToLocaltime(c( "2017-10-29 01:00:00+0200", "2017-10-29 01:30:00+0200", "2017-10-29 02:00:00+0200", "2017-10-29 02:30:00+0200", "2017-10-29 02:00:00+0100", "2017-10-29 02:30:00+0100", "2017-10-29 03:00:00+0100", "2017-10-29 03:30:00+0100" ))
#> Converting 8 timestamps ... ok.
class(times)
#> [1] "POSIXct" "POSIXt"
plot(times, rep(1, length(times)), ylab = "", xlab = "LocalTime")