I am using XAMPP - PHP and MYSQL servers. When I tried to use following -
getRates(date(\'Y-m-d\'));
function getRates($cDate)
{
$query = \"SELECT * FROM
MySQL stores datetime as [yyyy-mm-dd hh:mm:ss] at the UTC timezone. Your field in the db may be set up incorrectly but it may help if you post it's parameters. You shouldn't need to change settings in the conf or php.ini files. I suspect the difference between UTC and your timezone is making the query fail at certain times of the day because the UTC timestamp has passed into the next day. You may need to compensate your date prior to making the query by adding (or subtracting) the right amount of time so the datetime matches UTC. Something like this: getRates(date("Y-m-d h:i:sa",(yourtimestamp + (7 * 60 * 60)))); Or declare the timezone prior to the query: date_default_timezone_set("America/New_York");