Re: [PHP-ES] Consulta Fecha y Hora

[email protected] (Lucas Crisman)
Newsgroups php.general.es
Message-ID <[email protected]>
Hola, tal vez estas líneas te sirvan.

<?php
$d1 = new DateTime(date('Y-m-d') . ' 00:00:00');
$d2 = new DateTime(date('Y-m-d H:i:s'));
$dif = $d1->diff($d2);
$segundos = $dif->s + $dif->i * 60 + $dif->h * 3600;
echo $segundos;
?>

Saludos,

Lucas Crisman

On 18/03/2011 17:31, Mario Soto Cordones wrote:
> Hola lista, tengo un problema, necesito obtener la hora actual a partir de
> los segundos transcurridos en el día hasta la  hora del cálculo…
>
>
>
> Hay alguna función en php que me permita obtener eso
>
>
>
> Saludos cordiales
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.