note 124355 added to class.dateinterval

From: Date: Wed, 30 Oct 2019 19:52:08 +0000
Subject: note 124355 added to class.dateinterval
Groups: php.notes 
Request: Send a blank email to php-notes+get-212873@lists.php.net to get a copy of this message
Please note that the hour field can be negative, especially in the context of switching to/from Daylight savings. Example: <?php $tz = new DateTimeZone("America/New_York"); $date_1 = new DateTime("2019-10-30 15:00:00",$tz); $date_2 = new DateTime("2019-11-21 14:30:20",$tz); echo $date_2->diff($date_1)->format("%a:%h:%i:%s"); // returns 21:-1:30:20 ---- Server IP: 208.43.231.9 Probable Submitter: 82.199.157.54 (proxied: 209.202.82.139) ---- Manual Page -- http://php.net/manual/en/class.dateinterval.php Edit -- https://master.php.net/note/edit/124355 Del: integrated -- https://master.php.net/note/delete/124355/integrated Del: useless -- https://master.php.net/note/delete/124355/useless Del: bad code -- https://master.php.net/note/delete/124355/bad+code Del: spam -- https://master.php.net/note/delete/124355/spam Del: non-english -- https://master.php.net/note/delete/124355/non-english Del: in docs -- https://master.php.net/note/delete/124355/in+docs Del: other reasons-- https://master.php.net/note/delete/124355 Reject -- https://master.php.net/note/reject/124355 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#212873) next »