note 15190 added to ref.datetime
| From: | nozimica at ing dot uchile dot cl | Date: | Fri, 31 Aug 2001 03:21:59 +0000 |
| Subject: | note 15190 added to ref.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17415@lists.php.net to get a copy of this message | ||
For all of us who speak Spanish, here is a function that adds a determinated amount of days to a
given date... the format for the incoming and the outgoing date is: DD-MM-YYYY
-----------------------
Para todos quienes hablamos español, he aquí una función que agrega una determinada cantidad de
días a una fecha dada... el formato tanto para la fecha de entrada como para la de salida es:
DD-MM-YYYY
function agregaDias($fecha, $dias) {
$t1 = mktime(0,0,0,substr($fecha,3,2),substr($fecha,0,2),substr($fecha,6,4));
$t2 = $t1 + 3600*24*$dias;
return date("d-m-Y", $t2);
}
http://www.php.net/manual/es/ref.datetime.php