Q:

timezone issue with mysql database

I insert some data in MySql database along with datetime. When I echo date, it show me correct time but when I insert it into database then it insert 2 hour ahead time.I'm using below for date and time,
date('Y-m-d H:i:s');

Do I have to change any settings in my cpanel?

A:

Just set date_default_timezone_set('America/Los_Angeles'); in your config file. Probably your timezone is wrong. Change 'America/Los_Angeles' by the correct for your region.
By config file I mean any file where you concentrate your configuration and you include before of any other code.

