DateTimeInterface::getOffsetDateTimeImmutable::getOffsetDateTime::getOffsetdate_offset_getReturns the timezone offset DescriptionObject-oriented style
public int DateTimeInterface::getOffset()
public int DateTimeImmutable::getOffset()
public int DateTime::getOffset()
Procedural style int date_offset_get(DateTimeInterface
$object )Returns the timezone offset. Parameters
Return ValuesReturns the timezone offset in seconds from UTC on success. ExamplesExample #1 DateTime::getOffset example Object-oriented style
Procedural style
The above examples will output: -18000 -14400 Note: -18000 = -5 hours, -14400 = -4 hours. |