DateTime::getOffset

PHP 5 >= 5.2.1, PHP 7, PHP 8
DateTime::getOffset - Returns the timezone offset
Manual
Code Examples

DateTime::getOffset( ): public int
public intDateTimeImmutable::getOffset

Parameters

object

Procedural style only: A DateTime object returned by date_create

Return Values

Returns the timezone offset in seconds from UTC on success.

Changelog

Version Description
8.0.0 Prior to this version, false was returned on failure.

Example of DateTime::getOffset

Show all examples for DateTime::getOffset

PHP Version:


Function DateTime::getOffset:

Date and Time Functions

Most used PHP functions