Reputation:
Hello I have hostgator web hosting and since their server are in America and I live in Europe my timezone in php is USA.How can I change timezone because I insert date and time in mysql.
Upvotes: 2
Views: 442
Reputation: 53
ini_set('date.timezone', 'America/Los_Angeles');
http://www.electrictoolbox.com/php-change-timezone/
other way to change timezone.
Upvotes: 0
Reputation: 241
If you're using a DateTime Object, use date_timezone_set
http://php.net/manual/en/datetime.settimezone.php
Upvotes: 0
Reputation: 105
Please use
date_default_timezone_set
http://php.net/manual/en/function.date-default-timezone-set.php
Following link will help you to find your timezone European
http://php.net/manual/en/timezones.europe.php
Upvotes: 0
Reputation: 95161
You can use date_default_timezone_set
in php
Example
date_default_timezone_set('Europe/Vienna');
Upvotes: 5