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!

Convert GMT to EST

Status
Not open for further replies.

Montana751

Programmer
Aug 14, 2001
64
US
My database holds the DateTime value as GMT. I need to subtract 5 hours to get EST. I tried taking the date field and minus 5, but thats not working. Need to keep in mind that subtractiing 5 hours could return previous date, so there has got to be more than subtracting hours.
 
Figured it out, you have to use the DateAdd function

DateAdd ("h",-5,{SCHEDULEDJOB.LASTEND} )

However, if you want to get all timezones, then the -5 should be replaced with a formula that identifies your current timezone and adds/subtracts from the GMT appropriately.
 
Montana: As Ido points out, you don't allow for timezone changes.

And of course it's different now, and may change again in the future.

Anyway, Ido has a product which handles it for you, your approach works fine for one timezone, if you also add in a date range check and adjust the time accordingly.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top