Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP date_default_timezone_get() Function

PHP date_default_timezone_get() Function

PHP Date/Time PHP Date/Time Reference Manual

Example

Return the default time zone:

Run Example »


Definition and Usage

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

Syntax

date_default_timezone_get();

Technical Details

Return Value: Returns the time zone as a string.
PHP Version: 5.1+
Changelog: Since PHP 5.4+, the time zone is no longer obtained from the operating system, and the TZ variable is no longer used.

PHP Date/Time PHP Date/Time Reference Manual