PHP date_default_timezone_get()Functions

PHP Date/TimePHP Date/Time Reference Manual

Examples

Returns 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: As of PHP 5.4+, the timezone is no longer obtained from the operating system, and the TZ variable is no longer used.


PHP Date/TimePHP Date/Time Reference Manual Other Extensions