Patch new-DateTime-getOffset-example for Documentation problem Bug #63415
Patch version 2012-11-01 23:46 UTC
Return to Bug #63415 |
Download this patch
Patch Revisions:
Developer: mike@mikehoward.com.au
// Create a timezone object
$dateTimeZoneSyd = new DateTimeZone("Australia/Sydney");
// Create a DateTime object (it's daylight savings time now - 2012-11-02)
$dateTimeSydney = new DateTime("now", $dateTimeZoneSyd);
// Calculate the GMT offset for the date/time contained in the object
$timeOffset = $dateTimeSydney->getOffset();
// Should show int(39600).
var_dump($timeOffset);
|