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