I want to convert a character sequence of hourly french times into POSIXct.
This sequence includes a dst clock change at 02:00 (CEST => CET) which causes duplicated output times.
char_dates <- c("2017-10-29 01:00:00",
"2017-10-29 02:00:00",
"2017-10-29 02:00:00",
"2017-10-29 03:00:00")
ymd_hms(char_dates, tz = "Europe/Paris")
Output:
"2017-10-29 01:00:00 CEST" "2017-10-29 02:00:00 CET" "2017-10-29 02:00:00 CET" "2017-10-29 03:00:00 CET"
Desired output (note the 2nd timezone):
"2017-10-29 01:00:00 CEST" "2017-10-29 02:00:00 CEST" "2017-10-29 02:00:00 CET" "2017-10-29 03:00:00 CET"
What is a good solution to achieve this ?
We can assume the dates are sorted, or that the user can provide a boolean vector (dst: yes/no) to tell lubridate which timezone to choose.