pkromer
asked on
curdate time zone offset
How would I make this query subtract 3 hours to offset a time zone difference? Our server which holds the data is on EST but I want the data pulled from this query to be PST. Thank you.
$t_query = "SELECT SUM(Total) AS num FROM orders WHERE date_purchased > CURDATE()";
$t_query = "SELECT SUM(Total) AS num FROM orders WHERE date_purchased > CURDATE()";
$t_query = "SELECT SUM(Total) AS num FROM orders WHERE date_purchased > (CURDATE() - INTERVAL 3 HOURS)";
ASKER
I get an error when i test that...
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'HOURS)' at line 1
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'HOURS)' at line 1
ASKER
btw, we are using PHP Version 4.3.10
ASKER
and MySQL Client API version 4.0.16
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect. Thank you very much.