isoToLocaltime: Text Timestamps to POSIXct

Description Usage Arguments Examples

View source: R/convert.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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"
))

class(times)
plot(times, rep(1, length(times)), ylab = "", xlab = "LocalTime")

KWB-R/kwb.datetime documentation built on July 9, 2021, 10:28 p.m.