Ver Mensaje Individual
  #8 (permalink)  
Antiguo 05/04/2013, 12:23
emilio_alac05
 
Fecha de Ingreso: septiembre-2012
Mensajes: 75
Antigüedad: 14 años, 1 mes
Puntos: 2
Respuesta: obtener la fecha actual

Checa esto adaptalo a tu necesidad, saludos.

Código PHP:
<?php
    $startDate 
= date("Y/m/d"); //aqui la fecha actual

    
$num = 30;

    
$endDate = "2013-06-10";  //aqui pones la fecha del proximo mantenimiento
    
    
list($year, $month, $day) = explode("/", $startDate);
        
$startDate = mktime(0, 0, 0, $month, $day, $year);

    list(
$year, $month, $day) = explode("-", $endDate);
        
$endDate = mktime(0, 0, 0, $month, $day, $year);

    
$totalDays = ($endDate - $startDate)/(60 * 60 * 24);
    echo 
$totalDays." Dias"."<br>";
    
        if(
$totalDays == $num){
            echo 
"Proximo a vencer";
        }
?>