PHP | date_offset_get() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The date_offset_get() function is an inbuilt function in PHP which is used to returns the timezone offset. This function returns the timezone offset in seconds from UTC (Universal Time Coordinated) on success or FALSE on failure. Syntax: Procedural Style: int date_offset_get( $object ) Object Oriented Style: int DateTime::getOffset( void ) int DateTimeImmutable::getOffset( void ) int DateTimeInterface::getOffset( void ) Parameters: This function accepts single parameter $object which is mandatory in procedural style. The DateTime object returned by date_create() function. But in case of object oriented style no parameter required. Return Value: This function returns the timezone offset in seconds from UTC(Universal Time Coordinated) on success or FALSE on failure. Below programs illustrate the date_offset_get() function in PHP: Program 1: php <?php $date1 = date_create('2018-09-12', timezone_open('Asia/Kolkata')); $date2 = date_create('20018-09-18', timezone_open('Asia/Singapore')); echo date_offset_get($date1) . "\n"; echo date_offset_get($date2) . "\n"; ?> Output: 19800 28800 Program 2: php <?php $date1 = new DateTime('2018-09-12', new DateTimeZone('Asia/Kolkata')); $date2 = new DateTimeImmutable('2018-09-18', new DateTimeZone('Asia/Singapore')); echo $date1->getOffset() . "\n"; echo $date2->getOffset() . "\n"; ?> Output: 19800 28800 Related Articles: PHP | date_date_set() Function PHP | date_parse_from_format() Function PHP | microtime() Function Reference: https://www.php.net/manual/en/datetime.getoffset.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