note 80198 deleted from function.date by felipe

From: Date: Fri, 04 Jan 2008 01:35:02 +0000
Subject: note 80198 deleted from function.date by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-134737@lists.php.net to get a copy of this message
Note Submitter: m-v-a-n-d-e-v-e-l-d-e at s-w-i-n dot e-d-u dot a-u ---- Need to find the date of 18 months ago? After doing some calculations I found this method. <?php if(date("m")<=5){ print "<br>".(date("Y")-2)."-".(date("m")+7).date("-d H:i:s"); $eighteen_months_ago = mktime(0, 0, 0, date("m")+7, date("d"), date("Y")-2); }else{ print "<br>".(date("Y")-1)."-".(date("m")-5).date("-d H:i:s"); $eighteen_months_ago = mktime(0, 0, 0, date("m")-5, date("d"), date("Y")-1); } ?>

« previous php.notes (#134737) next »