I am currently on some shared hosting and when i use NOW() or CURRENT_TIMESTAMP in my php sql queries the inserted data is 7 hours behind.
Is there something i can do in PHP to correct this?
I have tried
date_default_timezone_set('Europe/Dublin');
but it didn’t seem to make a difference.
OUTPUT:
php time: 1347544854
date: 2012-09-13 14:0054 UTC
mysql array(3) {
["zone"]=> string(6) "SYSTEM"
["utcts"]=> string(19) "2012-09-13 14:00:54"
["now"]=> string(19) "2012-09-13 07:00:54"
}
When using the mysql functions, it’s going to use the timezone set in MySQL. You can change the timezone by using this in your query: