note 50037 deleted from function.time by aidan
| From: | aidan@php.net | Date: | Sat, 08 Oct 2005 01:03:56 +0000 |
| Subject: | note 50037 deleted from function.time by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96612@lists.php.net to get a copy of this message | ||
Note Submitter: tyconzor at hotmail dot com
----
Just a simple way to calculate the time passed since a certain date:
<?php
$delta = time() - mktime(0, 0, 0, 2, 7, 2005);
/* Returns seconds since the date used with mktime() */
echo round($delta/(60*60*24),2);
/*
(60*60*24) Returns days passed since the above date.
If you want your script to return minutes, just devide by
60, etc.
*/
?>
I know this is a trivial problem, but this script can be handy for uptime statistics on your page or
something similar.