How to Change Time Zone Settings in PHP?

UTC is the default timezone for PHP on the most server. The date_default_timezone_set() function can be used to update the default timezone for all PHP date/time functions.

You can find List of supported Timezones here

Example: Set default timezone using PHP function.

<?php
date_default_timezone_set("America/New_York");
echo date_default_timezone_get();
?>

Example: Set default timezone using php.ini

date.timezone = America/Los_Angeles

Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.