Posted by Toby A Inkster on 03/06/07 10:38
Davide wrote:
> I need to build a script wich can calulate the difference from a
> specific date "2007-03-01" to current date.
$old_date = strtotime('2007-03-01');
$now_date = time();
$date_diff = $now_date - $old_date;
printf( "Date difference is %.2f seconds (%.2f days).\n",
$date_diff,
$date_diff/(24*60*60) );
See also:
http://www.php.net/manual/en/function.strtotime.php
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
Navigation:
[Reply to this message]
|