note 118796 added to datetime.settimezone

From: Date: Sun, 07 Feb 2016 19:31:45 +0000
Subject: note 118796 added to datetime.settimezone
Groups: php.notes 
Request: Send a blank email to php-notes+get-204893@lists.php.net to get a copy of this message
It appears that what forzi at mail333 dot com said is correct. When you reset the timezone on a DateTime object using a timezone that was instantiated with a GMT offset (e.g. <?php new DateTimeZone('-0500'); ?>) the timestamp as reported by <?php $dt->format('U'); ?> changes. However, the value reported by <?php $dt->getTimestamp(); ?> does _not_ change. I'm not sure if this is expected behavior, but it is not what I would expect. In any case, other output values from format() seem to be accurate, and the true timestamp is still accessible via getTimestamp(). ---- Server IP: 72.52.91.14 Probable Submitter: 72.195.139.26 ---- Manual Page -- http://php.net/manual/en/datetime.settimezone.php Edit -- https://master.php.net/note/edit/118796 Del: integrated -- https://master.php.net/note/delete/118796/integrated Del: useless -- https://master.php.net/note/delete/118796/useless Del: bad code -- https://master.php.net/note/delete/118796/bad+code Del: spam -- https://master.php.net/note/delete/118796/spam Del: non-english -- https://master.php.net/note/delete/118796/non-english Del: in docs -- https://master.php.net/note/delete/118796/in+docs Del: other reasons-- https://master.php.net/note/delete/118796 Reject -- https://master.php.net/note/reject/118796 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204893) next »