note 40869 deleted from function.date by nlopess

From: Date: Wed, 17 Mar 2004 19:19:13 +0000
Subject: note 40869 deleted from function.date by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-66981@lists.php.net to get a copy of this message
Note Submitter: todor@todor.net ---- better this one .... <?PHP function min_date($a,$b){ if ( date('y',strtotime ($a)) < date('y',strtotime ($b)) ) return $a ; elseif ( date('Y',strtotime ($a)) > date('Y',strtotime ($b)) ) return $b ; elseif ( date('m',strtotime ($a)) < date('m',strtotime ($b)) ) return $a ; elseif ( date('m',strtotime ($a)) > date('m',strtotime ($b)) ) return $b ; elseif ( date('d',strtotime ($a)) < date('d',strtotime ($b)) ) return $a ; elseif ( date('d',strtotime ($a)) > date('d',strtotime ($b)) ) return $b ; return $a ; } $dt1 = '01-JAN-73'; $dt2 = '15-OCT-06'; echo min_date($dt1,$dt2) ; ?>

« previous php.notes (#66981) next »