note 81875 added to function.date

From: Date: Mon, 17 Mar 2008 16:09:19 +0000
Subject: note 81875 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-137138@lists.php.net to get a copy of this message
Here is an easy MySQL way of getting the difference in dates. For me it is more logical to do this on the select than running it though an additional PHP function after selecting the date. But depends on what your doing of course. I hope it helps. SELECT ABS(DATEDIFF(NOW(),yourdateField)) as dateDiff ---- Server IP: 209.41.74.194 Probable Submitter: 74.93.182.242 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/81875 Del: integrated -- https://master.php.net/note/delete/81875/integrated Del: useless -- https://master.php.net/note/delete/81875/useless Del: bad code -- https://master.php.net/note/delete/81875/bad+code Del: spam -- https://master.php.net/note/delete/81875/spam Del: non-english -- https://master.php.net/note/delete/81875/non-english Del: in docs -- https://master.php.net/note/delete/81875/in+docs Del: other reasons-- https://master.php.net/note/delete/81875 Reject -- https://master.php.net/note/reject/81875 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137138) next »