Questions & AnswersCategory: PHPHow to change the timezone in PHP file?
Gowri Shankar Staff asked 1 year ago

How to change the timezone in PHP file?

You can use ini_set() in your PHP script to set/change the current timezone to e.g. the timezone that is used in Los Angeles, you would do this:

ini_set('date.timezone', 'America/Los_Angeles');

All subsequent requests to date and time functions would use America/Los Angeles as the timezone.


Sign In


Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.