note 33252 added to function.date

From: Date: Fri, 20 Jun 2003 05:35:33 +0000
Subject: note 33252 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-50698@lists.php.net to get a copy of this message
If you want to just compare any two dates, store them in ISO format (yyyy-mm-dd) and compare with < or > or == operators. For example, $date1 = "2003-12-30"; $date2 = "2004-02-15"; if ($date1 < $date2) echo "date1 is less than date2"; Note, $date1 & $date2 are just strings. You can use this logic in MySQL too. HTH, R. Rajesh Jeba Anbiah ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33252 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33252&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33252&report=yes

« previous php.notes (#50698) next »