I need to write a function that converts a time from GMT to EST taking daylight savings time into consideration.
On a high level I was thinking of doing the following:
a) a table that holds the daylight saving dates for this year and upcoming years. does anyone know a website that has these dates published?
b) if the date passed to the function is greater or equal to the date for the fall daylight saving date (i.e., 11/2013) but less than the spring daylight saving date (i.e., 3/2014) then subtract 6 from the gmt to get est
c) if the date passed to the function is greater or equal to the date for the fall daylight saving date (i.e., 3/2014) but less than the spring daylight saving date (i.e., 11/2014) then subtract 5 from the gmt to get est
On a high level I was thinking of doing the following:
a) a table that holds the daylight saving dates for this year and upcoming years. does anyone know a website that has these dates published?
b) if the date passed to the function is greater or equal to the date for the fall daylight saving date (i.e., 11/2013) but less than the spring daylight saving date (i.e., 3/2014) then subtract 6 from the gmt to get est
c) if the date passed to the function is greater or equal to the date for the fall daylight saving date (i.e., 3/2014) but less than the spring daylight saving date (i.e., 11/2014) then subtract 5 from the gmt to get est