<?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-01-09 01:49:29
2026-01-09 12:19:29
$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
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.