@@ -135,21 +135,19 @@ a timestamp, required other functions of the package. Similarly,
135135timestamp.
136136
137137 #around daylight saving time step in Central European time
138- tzBack <- Sys.getenv('TZ'); Sys.setenv(TZ = "Europe/Berlin")
139- t1 <- as.POSIXct("2018-10-28 01:30")
140- (dateSeq <- seq(t1, by = "30 min", length.out = 6))
141-
142- ## [1] "2018-10-28 01:30:00 CEST" "2018-10-28 02:00:00 CEST" "2018-10-28 02:30:00 CEST" "2018-10-28 02:00:00 CET" "2018-10-28 02:30:00 CET" "2018-10-28 03:00:00 CET"
143-
144- (hoursAhead <- getHoursAheadOfUTC(dateSeq))
145-
146- ## [1] 2 2 2 1 1 1
147-
148- (facHours <- getFractionalHours(dateSeq))
149-
150- ## [1] 1.5 2.0 2.5 3.0 3.5 4.0
151-
152- Sys.setenv(TZ = tzBack)
138+ t1 <- as.POSIXct("2018-10-28 01:30", tz = "Europe/Berlin")
139+ dateSeq <- seq(t1, by = "30 min", length.out = 6)
140+ hoursAheadOfUTC <- getHoursAheadOfUTC(dateSeq)
141+ fracHours <- getFractionalHours(dateSeq)
142+ data.frame(dateSeq, hoursAheadOfUTC, fracHours)
143+
144+ ## dateSeq hoursAheadOfUTC fracHours
145+ ## 1 2018-10-28 01:30:00 2 1.5
146+ ## 2 2018-10-28 02:00:00 2 2.0
147+ ## 3 2018-10-28 02:30:00 2 2.5
148+ ## 4 2018-10-28 02:00:00 1 3.0
149+ ## 5 2018-10-28 02:30:00 1 3.5
150+ ## 6 2018-10-28 03:00:00 1 4.0
153151
154152<!--
155153See the [package vignettes](https://github.com/bgctw/solartime/tree/master/vignettes) (*.md) for further examples.
0 commit comments