note 90714 added to function.gmmktime

From: Date: Tue, 05 May 2009 20:00:00 +0000
Subject: note 90714 added to function.gmmktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-154260@lists.php.net to get a copy of this message
GMT time is useful for avoiding the daylight's savings issue. I had to use it to get a working date difference function: function dateDiff($date1, $date2) //returns the difference, in days, between two dates. avoids the daylight's savings issue by using GMT { $date1 = date_parse($date1); $date2 = date_parse($date2); return ((gmmktime(0, 0, 0, $date1['month'], $date1['day'], $date1['year']) - gmmktime(0, 0, 0, $date2['month'], $date2['day'], $date2['year']))/3600/24); } ---- Server IP: 64.71.164.2 Probable Submitter: 156.56.226.183 ---- Manual Page -- http://www.php.net/manual/en/function.gmmktime.php Edit -- https://master.php.net/note/edit/90714 Del: integrated -- https://master.php.net/note/delete/90714/integrated Del: useless -- https://master.php.net/note/delete/90714/useless Del: bad code -- https://master.php.net/note/delete/90714/bad+code Del: spam -- https://master.php.net/note/delete/90714/spam Del: non-english -- https://master.php.net/note/delete/90714/non-english Del: in docs -- https://master.php.net/note/delete/90714/in+docs Del: other reasons-- https://master.php.net/note/delete/90714 Reject -- https://master.php.net/note/reject/90714 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154260) next »