PHP date_default_timezone_get() Function

❮ PHP Date/Time Reference

Example

Return the default timezone:

<?php
echo date_default_timezone_get();
?>
Try it Yourself »

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+
PHP Changelog: PHP 5.4: The TZ variable is no longer used to guess the timezone

❮ PHP Date/Time Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.