Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/06/2005, 15:44
Avatar de Pazosele
Pazosele
 
Fecha de Ingreso: marzo-2005
Ubicación: BCN - España
Mensajes: 200
Antigüedad: 19 años, 1 mes
Puntos: 0
the code

Aqui tienes el codigo:
Código PHP:
<?

function add_zero($a){
   
$b $a;
   if(
strlen($a) == 1){
       
$b "0".$a;    
   }    
   return 
$b;
}

function 
day_th($gmt$no=30){
   
// default $no = 30 later
           
// get GMT datetime as standard for 'now()'

// $gmt = gmstrftime("%Y-%m-%d %H:%M:%S");

$d explode(" ",$gmt);
$date $d[0];
$time $d[1];

$date_x explode("-",$date);
$year $date_x[0];
$month $date_x[1];
$day $date_x[2];

$time_x explode(":",$time);
$hour $time_x[0];
$minute $time_x[1];
$second $time_x[2];

// create UNIX TIMESTAMP of the GMT above
$t mktime($hour$minute$second$month$day$year);

// 1 h = 3600 sec
// 1 d = 24 h
// 1 d = 86400 sec
// 30 d = 2592000 sec

$unix_stamp 86400 $no;

$res getdate($t $unix_stamp); 

$ris array_values($res);

list(
$seconds,$minutes,$hours,$mday,$wday,$mon,$year,
$yday,$weekday,$month,$unix) = $ris;

$mon add_zero($mon);
$mday add_zero($mday);
$seconds add_zero($seconds);
$minutes add_zero($minutes);
$hours add_zero($hours);

$day_th $year."-".$mon."-".$mday." ".$hours.":".$minutes.":".$seconds;

return 
$day_th;
}

// $gmt = gmstrftime("%Y-%m-%d %H:%M:%S");
$gmt "2005-02-28 00:00:01";

$nextdate day_th($gmt$no=1);

echo 
$gmt."<br>".$nextdate."<br>";
?>
Espero que te sirva
Un Saludo!
__________________
Share our Knowledge!
Adura Vita!

Última edición por Pazosele; 02/06/2005 a las 15:50