THE WORLD'S LARGEST WEB DEVELOPER SITE

PHP date_default_timezone_get() Function

❮ PHP Date/Time Reference

Example

Return the default timezone:

<?php
echo date_default_timezone_get();
?>
Run example »

Definition and Usage

The date_default_timezone_get() function returns the default timezone used by all date/time functions in the script.


Syntax

date_default_timezone_get();

Technical Details

Return Value: Returns the timezone as a string
PHP Version: 5.1+
Changelog: From PHP 5.4+; The timezone is no longer guessed from information in OS, and the TZ variable is no longer used

❮ PHP Date/Time Reference