Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/03/2009, 06:47
Chuecko
 
Fecha de Ingreso: junio-2008
Mensajes: 119
Antigüedad: 15 años, 10 meses
Puntos: 1
Saber si es una fecha es hoy..., esta bien?

Hola a todos, necesito saber mediante php si un timestamp corresponde al dia de la fecha actual...

Lo que tengo y se me ocurrio es usando el timestamp, hacer esto
Código PHP:
$hoyes=$administrador->fechaLegible(time());
//$hoyes es del tipo dd/mm/aaaa

if ($administrador->fechaLegible(timestamp)==$hoyes){
    echo 
'Si el time stamp es del dia $hoyes';

donde fecha legible es...
Código PHP:
function fechaLegible($timestamp){
$date=getDate($timestamp);
$dia=$date['mday'];
$mes=$date['mon'];
if (
strlen($date['mday'])==1){
$dia="0".$date['mday'];
}
if (
strlen($date['mon'])==1){
$mes="0".$date['mon'];
}
return 
$dia."-".$mes."-".$date['year'];
//02-01-2009 ejemplo

por ahora necesito saber si un timestamp, corresponde al dia actual, nose si existe una función tipo now(tipestamp) que te devuelva verdadero o falso o algo asi. Nose si mi forma de evaluar string es la mas correcta, y/o eficiente...

Desde ya... , Muchas Gracias....

Última edición por Chuecko; 27/03/2009 a las 06:49 Razón: taba mal...