DateTime
PHP Manual

DateTime::getOffset

(PHP 5 >= 5.2.0)

DateTime::getOffsetReturns the daylight saving time offset

설명

public int DateTime::getOffset ( void )
int date_offset_get ( DateTime $object )

인수

object

절차식 전용: date_create()가 반환하는 DateTime 객체.

반환값

Returns DST offset in seconds on success or FALSE on failure.

예제

Example #1 Comparing offsets between Summer and Winter

<?php
date_default_timezone_set
('Europe/London');

$winter = new DateTime('2008-12-25 14:25:41');
$summer = new DateTime('2008-07-14 14:25:41');

echo 
$winter->getOffset(); // Winter offset: 0
echo $summer->getOffset(); // Summer offset: 3600 = 1 hour
?>


DateTime
PHP Manual