note 89909 modified in function.date-add by danbrown

From: Date: Fri, 27 Mar 2009 20:08:02 +0000
Subject: note 89909 modified in function.date-add by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-152546@lists.php.net to get a copy of this message
Just add month(s) on the orginal date. <?php function add_date($orgDate,$mth){ $cd = strtotime($orgDate); $retDAY = date('Y-m-d', mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd))); return $retDAY; } ?> --was-- Just add month(s) on the orginal date. function add_date($orgDate,$mth){ $cd = strtotime($orgDate); $retDAY = date('Y-m-d', mktime(0,0,0,date('m',$cd)+$mth,date('d',$cd),date('Y',$cd))); return $retDAY; } http://php.net/manual/en/function.date-add.php

« previous php.notes (#152546) next »