Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/03/2010, 14:25
Hidek1
Colaborador
 
Fecha de Ingreso: octubre-2009
Ubicación: Tokyo - Japan !
Mensajes: 3.867
Antigüedad: 14 años, 6 meses
Puntos: 334
Respuesta: Formato al restar 2 fechas

Código PHP:
Ver original
  1. <?php
  2. function restaFechas($dFecIni, $dFecFin){
  3.     $meses = floor((strtotime($dFecFin)-strtotime($dFecIni)) / 60 / 60 / 24 / 30);
  4.     $dias = (round((strtotime($dFecFin)-strtotime($dFecIni)) / 60 / 60 / 24)) - $meses * 30;
  5.     return "meses: ".$meses." dias: ".$dias;
  6. }
  7. echo restaFechas("21-01-2010", "01-03-2010");
  8. ?>

rehice un poco la funcion
en realidad fue un tanto rapido.. ve si te sirve
__________________
More about me...
~ @rhyudek1
~ Github