PHP | date_timezone_get() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The date_timezone_get() function is an inbuilt function in PHP which is used to return time zone relative to given DateTime. This function returns a DateTimeZone object on success or False on failure. Syntax: Procedural style: date_timezone_get( $object ) Object oriented style: DateTime::getTimezone( void ) DateTimeImmutable::getTimezone( void ) DateTimeInterface::getTimezone( void ) Parameters: This function accepts single parameter $object which is mandatory in procedural style. It is used to specify the DateTime object which is returned by the date_create() function. The object oriented style does not require any parameter. Return Value: This function returns a DateTimeZone object on success or False on failure. Below programs illustrate the date_timezone_get() function in PHP: Program 1: php <?php // Create DateTime object $date = date_create(null, timezone_open('Asia/Kolkata')); // Return the timezone of given DateTime $time_zone = date_timezone_get($date); // Return the DateTimeZone object echo timezone_name_get($time_zone); ?> Output: Asia/Kolkata Program 2: php <?php // Create DateTime object using DateTimeZone $date = new DateTime(null, new DateTimeZone('Asia/Kolkata')); // Return the timezone of given DateTime $time_zone = $date->getTimezone(); // Return the DateTimeZone object echo $time_zone->getName(); ?> Output: Asia/Kolkata Related Articles: PHP | timezone_version_get() Function PHP | gmdate() Function PHP | date_date_set() Function Reference: https://www.php.net/manual/en/datetime.gettimezone.php Create Quiz Comment V vijay_raj Follow 0 Improve V vijay_raj Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-date-time PHP-function +1 More Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like