<?Php
echo date_default_timezone_set();
?>
We can set it like this
date_default_timezone_set('America/Chicago');
After setting the time zone , you can read the same by using date_default_timezone_get() function.
;date.timezone =
Change it to
date.timezone ="Asia/Calcutta";
You can change the area as per your requirement by using time zone identifier .
date_default_timezone_set('America/New_York');
echo date('Y-m-d H:i:s').'<br>'; // Output: Current time in New York
date_default_timezone_set('Asia/Kolkata');
echo date('Y-m-d H:i:s'); // Output: Current time in Kolkata
Output
2026-09-09 12:54:46
2026-09-09 22:24:46
$timezones = timezone_identifiers_list();
print_r($timezones);
Or to display as list
$timezones = timezone_identifiers_list();
foreach($timezones as $key=>$value){
echo "$key : $value".'<br>';
}
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.