Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with UTC to EST/EDT time formula

Status
Not open for further replies.

sugabutt

Technical User
Jan 3, 2009
16
US
I have a database with a UTC date. I have converted it to GMT format (i.e. 4/12/2010 5:30:18PM). I'm using the following ShiftDate formula to convert the GMT to Eastern time.

ShiftDateTime ({@dateutc}, "UTC,000,UTC", "EST,300,EDT")

It works but it's not taking into account Daylight Saving Time. Daylight Saving Time started this year on March 14, and I have data before and after this date. The records before March 14 are converting correctly, but not the ones after.

Any suggestions on what I may be doing wrong?
 
datevar t:=date({Orders.Ship Date});

if t in
dateadd('d',8 - dayofweek(date(year(t),3,7)),date(year(t),3,7))
to
dateadd('d',8 - dayofweek(date(year(t),11,1)),date(year(t),11,1))
then
dateadd('h',4,{Orders.Ship Date})
else
dateadd('h',5,{Orders.Ship Date})

-------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top