note 83594 added to function.time

From: Date: Tue, 03 Jun 2008 18:30:20 +0000
Subject: note 83594 added to function.time
Groups: php.notes 
Request: Send a blank email to php-notes+get-140093@lists.php.net to get a copy of this message
Dude: function get_formatted_timediff($then, $now = false) { $now = (!$now) ? time() : $now; $timediff = ($now - $then); Why did you take $now - $then??? I put a future time and it appear to be "minus" time and with "ago"... Later on I found out that you used $now - $then The correct would be $then - $now. Regards, Binh Nguyen http://binh.name http://apmart.com ---- Server IP: 210.245.120.83 Probable Submitter: 222.254.88.162 ---- Manual Page -- http://www.php.net/manual/en/function.time.php Edit -- https://master.php.net/note/edit/83594 Del: integrated -- https://master.php.net/note/delete/83594/integrated Del: useless -- https://master.php.net/note/delete/83594/useless Del: bad code -- https://master.php.net/note/delete/83594/bad+code Del: spam -- https://master.php.net/note/delete/83594/spam Del: non-english -- https://master.php.net/note/delete/83594/non-english Del: in docs -- https://master.php.net/note/delete/83594/in+docs Del: other reasons-- https://master.php.net/note/delete/83594 Reject -- https://master.php.net/note/reject/83594 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140093) next »