PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

date_parse> <date_modify
Last updated: Fri, 28 Nov 2008

view this page in

date_offset_get

(PHP 5 >= 5.1.0)

date_offset_getReturns the daylight saving time offset

Description

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

Parameters

object

Procedural style only: A DateTime object returned by date_create()

Return Values

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

Examples

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
?>



add a note add a note User Contributed Notes
date_offset_get
There are no user contributed notes for this page.

date_parse> <date_modify
Last updated: Fri, 28 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites