Re: Convert Date time into Seconds
| From: | Dan | Date: | Mon, 25 Jun 2007 21:32:55 +0000 |
| Subject: | Re: Convert Date time into Seconds | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257763@lists.php.net to get a copy of this message | ||
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@insightbb.com> wrote in message news:25.16.19091.8FBFD764@pb1.pair.com...
Cool, Like Ambien, It worked like a dream. "Robert Cummings" <robert@interjinn.com> wrote in message news:1182653144.9203.24.camel@blobule...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. | `------------------------------------------------------------'