Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/04/2007, 04:50
lauraj
 
Fecha de Ingreso: marzo-2006
Mensajes: 46
Antigüedad: 18 años, 11 meses
Puntos: 0
Re: Siguiente fecha

Hola grg,

Lo que necesitaba es saber el siguiente día a uno dado. Lo necesitaba para hallar los días que hay entre dos fechas.

Finalmente pude resolverlo:

Código:
function DatesBetween($startDate, $endDate){
    // get the number of days between the two given dates.
    $days = (strtotime($endDate) - strtotime($startDate)) / 86400 + 1;
    $startMonth = date("m", strtotime($startDate));
    $startDay = date("d", strtotime($startDate));
    $startYear = date("Y", strtotime($startDate));   
    $dates;//the array of dates to be passed back
    for($i=0; $i<$days; $i++){
        $dates[$i] = date("n/j/Y", mktime(0, 0, 0, $startMonth , ($startDay+$i), $startYear));
    }
    return $dates;   
}
Saludos y gracias,

Laura.