Below is my R-code that is behaving weirdly. I expect a time of 22:00 as entered but i get 23:00.
as.POSIXct(chron(dates="01/04/06",times="22:00:00"),tz="CET")
[1] "2006-01-04 23:00:00 CET"
In the next line of my code i use the results to select a window from an xts/zoo object: Therefore just ignoring the error and instead entering 21:00 (in above) wasnt useful since it returns the wrong data. Windowing with the result of the code above returns the correct values.
head(qs<-as.zoo(window(Q,start=as.POSIXct(chron(dates="01/04/06",times="22:00:00"),tz="CET"),end=as.POSIXct(chron(dates="01/05/06",times="21:00:00"),tz="CET"))))
Here is a sample set of the data (Q
):
Stage.Qm Flow.Qm Stage.QmDB Flow.QmDB Stage.Q1000 Flow.Q1000 Stage.Q1000DB Flow.Q1000DB
2006-01-04 23:00:00 541.1589 5.636957 541.1592 5.646017 541.5708 20.44692 541.5708 20.44692
2006-01-04 23:01:00 541.1589 5.637268 541.1592 5.645087 541.5701 20.41321 541.5701 20.41321
2006-01-04 23:02:00 541.1589 5.638604 541.1588 5.635806 541.5701 20.40946 541.5701 20.40946
2006-01-04 23:03:00 541.1589 5.638979 541.1588 5.635694 541.5704 20.42712 541.5704 20.42712
2006-01-04 23:04:00 541.1589 5.639619 541.1590 5.640691 541.5710 20.45848 541.5710 20.45848
2006-01-04 23:05:00 541.1590 5.640662 541.1591 5.641682 541.5715 20.47893 541.5715 20.4789