September 3, 2013 at 11:03 am
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
September 3, 2013 at 11:54 am
Eastern Daylight Time (EDT) is UTC (GMT) -4 hours
Eastern Standard Time (EST) is UTC (GMT) -5 hours
You should be able to find all the information you need here:
Daylight Saving Time – DST
September 3, 2013 at 11:18 pm
Use GETUTCDATE() which is available in SQL Serevr , it will convert your timezone into GMT .
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy