# load and prepare data
data(winddata)
# format time stamp
time.stamp <- formatTS(time.stamp=winddata[,1])
# format time stamp with given pattern
time.stamp.2 <- formatTS(time.stamp=winddata[,1], "%d.%m.%Y %H:%M")
# wrong pattern (%y)
time.stamp.2 <- formatTS(time.stamp=winddata[,1], "%d.%m.%y %H:%M")
# strange time stamp pattern
ts <- c("TS 08/2012-10 8h10m30s", "TS 08/2012-10 8h20m30s",
"TS 08/2012-10 8h30m30s")
time.stamp.3 <- formatTS(time.stamp=ts) # pattern not found
time.stamp.3 <- formatTS(time.stamp=ts, "TS %m/%Y-%d %Hh%Mm%Ss")
Run the code above in your browser using DataLab