Re: Convert Date time into Seconds
| From: | Robert Cummings | Date: | Sun, 24 Jun 2007 02:45:43 +0000 |
| Subject: | Re: Convert Date time into Seconds | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257716@lists.php.net to get a copy of this message | ||
On Sat, 2007-06-23 at 21:29 -0500, kvigor wrote:
> Good Day,
>
> I'm chech if 24hrs has passed between these 2 datetimes:
>
> $dTime1 = 2007-06-21 11:08:09;
>
> $dTime2 = 2007-06-22 07:08:09;
>
> I'd really like to convert the datetimes above into a format I can do
> regular math them.
<?php
echo ($foo = strtotime( '2007-06-21 11:08:09' ))."\n";
echo date( 'Y/m/d H:i:s', $foo )."\n";
?>
$foo contains a unix timestamp (the time in seconds since the Epoch).
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'