Re: Convert Date time into Seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Also if you're planning on doing regular math with the outputs it's pretty easy to check if it's been 24 hours if you're using a unix time stamp, if((larger - smaller) >= 86400) do something. ""kvigor"" <k3cheese@xxxxxxxxxxxxx> wrote in message news:25.16.19091.8FBFD764@xxxxxxxxxxxxxxx
Cool,

Like Ambien, It worked like a dream.


"Robert Cummings" <robert@xxxxxxxxxxxxx> wrote in message news:1182653144.9203.24.camel@xxxxxxxxxx
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.          |
`------------------------------------------------------------'


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux