Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/07/2003, 15:49
Avatar de BrujoNic
BrujoNic
Super Moderador
 
Fecha de Ingreso: noviembre-2001
Ubicación: Costa Rica/Nicaragua
Mensajes: 16.935
Antigüedad: 24 años, 11 meses
Puntos: 655
Código PHP:
function dif_dias ($day, $month, $year) 
{
    
$target = mktime(7,0,0,$month,$day,$year); 
    
$diff = $target - time(); 

    
$days = ($diff - ($diff % 86400)) / 86400; 
    
$diff = $diff - ($days * 86400); 
    
$hours = ($diff - ($diff % 3600)) / 3600; 
    
$diff = $diff - ($hours * 3600); 
    
$minutes = ($diff - ($diff % 60)) / 60; 
    
$diff = $diff - ($minutes * 60); 
    
$seconds = ($diff - ($diff % 1)) / 1; 

    
$restante = "";
    
$month = $days-30;

    if (
$month <=0 ){
      
$month =0;
    }else{
      
$month = 1;
    }

    if (
$days > 0 )
      
$restante = $restante . $days . " días "; 
    if ((
$hours >= 0) && ($restante != ""))
      
$restante = $restante . $hours . " hrs. "; 
    if ((
$minutes >= 0) && ($restante != ""))
      
$restante = $restante . $minutes . " min."; 
    if ((
$seconds > 0) && ($restante ==""))
      
$restante = $restante . $seconds . " seg."; 

    if (
$restante ==""){
      echo 
"0 dias 0 hrs. 0 min."; 
    }else{
      echo 
$restante; 
    }
   return 
$restante;
} 
__________________
La tecnología está para ayudarnos. No comprendo el porqué con esa ayuda, la gente escribe TAN MAL.
NO PERDAMOS NUESTRO LINDO IDIOMA ESPAÑOL