Link to home
Start Free TrialLog in
Avatar of pkromer
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()";
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

$t_query = "SELECT SUM(Total) AS num FROM orders WHERE date_purchased > (CURDATE() - INTERVAL 3 HOURS)";
Avatar of pkromer
pkromer

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
Avatar of pkromer

ASKER

btw, we are using PHP Version 4.3.10
Avatar of pkromer

ASKER

and MySQL Client API version  4.0.16  
ASKER CERTIFIED SOLUTION
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pkromer

ASKER

perfect. Thank you very much.