The DateTime::getOffset functions returns the daylight saving time offset. It returns DST offset in seconds on success or False on failure.
The DateTime::getOffset functions returns the daylight saving time offset. It returns DST offset in seconds on success or False on failure.This DateTime::getOffset functions returns the daylight saving time offset. It returns DST offset in seconds on success or False on failure.
public int DateTime::getOffset ( void )
int date_offset_get ( DateTime $object )
object - Procedural style only: A DateTime object returned by date_create()
date_default_timezone_set('India/Kolkata');
$winter = new DateTime('2009-01-24 14:25:41');
$summer = new DateTime('2009-06-14 14:25:41');
echo $winter->getOffset(); // Winter offset: 0
echo $summer->getOffset(); // Summer offset: 3600 = 1 hour
?>