I am having a problem with performing time calculations. My Server runs on ET (Eastern Time) However we have a few customers that are not in that time zone. All of the times that go into the database are all in ET. What I am trying to do is pull data and do a time calculation in the query to collect the correct records.
In the code included the startT and endT columns are time type fields.
The thinking behind the query is that if I add 3 hours to the current server time it will pull the correct records for people in california. i.e. if its 1 in california the server thinks its actually 4 so I need to pull records and add 3 hours to what the database has recorded so that I can compare it to the current time on the server.
I hope this makes sense.
date_format(day_planner.endT, '%h:%i %p') as ending
LEFT OUTER JOIN day_planner ON users.UID = day_planner.UID
startD = CURDATE()
CURTIME() BETWEEN TIME(DATE_ADD(day_planner.startT, INTERVAL + 3 HOUR)) AND TIME(DATE_ADD(day_planner.endT, INTERVAL + 3 HOUR))