At what days does the summer time start /end in a given year?

date_range_CEST(year)

Arguments

year

Scalar year number between 1980 and 2100.

Examples

# At what days does summer time start and end, respectively, in 2010? date_range_CEST(2010)
#> begin end #> "2010-03-28" "2010-10-31"
# Check if summer time really starts at 2010-03-28. Timestamps between # 2:00 (inclusive) and 3:00 (exclusive) do not exist in Central European Time # Note that in this case R removes the time information! as.POSIXct("2010-03-28 01:59:59", tz = "Europe/Berlin") # CET
#> [1] "2010-03-28 01:59:59 CET"
as.POSIXct("2010-03-28 02:00:00", tz = "Europe/Berlin") # Time removed!
#> [1] "2010-03-28 CET"
as.POSIXct("2010-03-28 02:59:59", tz = "Europe/Berlin") # Time removed!
#> [1] "2010-03-28 CET"
as.POSIXct("2010-03-28 03:00:00", tz = "Europe/Berlin") # CEST
#> [1] "2010-03-28 03:00:00 CEST"
# Check if summer time really ends at "2010-10-31. Timestamps between # 2:00 (inclusive) and 3:00 (exclusive) exist twice, once in CEST and a # second time in CET, so R does not know which one you mean! as.POSIXct("2010-10-31 01:00:00", tz = "Europe/Berlin") # CEST
#> [1] "2010-10-31 01:00:00 CEST"
as.POSIXct("2010-10-31 02:00:00", tz = "Europe/Berlin") # CEST
#> [1] "2010-10-31 02:00:00 CEST"
# R seems to decide (on my computer!) that times before 02:01:50 belong to # CEST and at or after that time belong to CET! as.POSIXct("2010-10-31 02:01:49", tz = "Europe/Berlin") # CEST
#> [1] "2010-10-31 02:01:49 CEST"
as.POSIXct("2010-10-31 02:01:50", tz = "Europe/Berlin") # CET
#> [1] "2010-10-31 02:01:50 CET"
as.POSIXct("2010-10-31 02:02:00", tz = "Europe/Berlin") # CET
#> [1] "2010-10-31 02:02:00 CET"
as.POSIXct("2010-10-31 03:00:00", tz = "Europe/Berlin") # CET
#> [1] "2010-10-31 03:00:00 CET"
# Get the starts and ends of CEST for a sequence of years date_range_CEST(2017:2020)
#> begin end #> 2017 "2017-03-26" "2017-10-29" #> 2018 "2018-03-25" "2018-10-28" #> 2019 "2019-03-31" "2019-10-27" #> 2020 "2020-03-29" "2020-10-25"