timeDate
stores some US holidays in GMT time zone. Given that the difference between GMT and US time zones differs throughout the year due to daylight savings, US holidays should not be stored in GMT time zone.
- EST = GMT - 5 while not in daylight savings
- EST = GMT - 4 from 2nd Sunday of March to 1st Sunday of November. (aka EDT)
This could bring some issues. For example:
library(timeDate)
holidayEIA <- function(x){ c(holidayNYSE(x),
USColumbusDay(x)@Data,
USVeteransDay(x)@Data)}
HolidaysEIA <- holidayEIA (2015)
#Output:
NewYork
[1] [2015-01-01 00:00:00] [2015-01-19 00:00:00] [2015-02-16 00:00:00]
[4] [2015-04-03 00:00:00] [2015-05-25 00:00:00] [2015-07-03 00:00:00]
[7] [2015-09-07 00:00:00] [2015-11-26 00:00:00] [2015-12-25 00:00:00]
[10] [2015-10-11 20:00:00] [2015-11-10 19:00:00]
Here holidayNYSE
is in EST/EDT time zone, while USColumbusDay
and USVeteransDay
are in GMT time zone. Have to do the following to equalize:
library(timeDate)
holidayEIA <- function(x){ c(holidayNYSE(x),
USColumbusDay(x)@Data+ 14400,
USVeteransDay(x)@Data+ 18000)}
HolidaysEIA <- holidayEIA (2015)
#Output
NewYork
[1] [2015-01-01] [2015-01-19] [2015-02-16] [2015-04-03] [2015-05-25]
[6] [2015-07-03] [2015-09-07] [2015-11-26] [2015-12-25] [2015-10-12]
[11] [2015-11-11]
This is not really a question, yet given SO is a Q&A site, allow me phrase it as one. Wouldn't you agree that timeDate
should store holidays in local time zones, as well as store all holidays for each country under the same time zone?