note 99730 added to function.time
| From: | MattD dot at osu1 dot php dot net | Date: | Wed, 01 Sep 2010 18:26:46 +0000 |
| Subject: | note 99730 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172249@lists.php.net to get a copy of this message | ||
The below will return to you the count of [units] that have passed since the start of the count.
This is useful if you are looking to do date-based entries to a table (ie set the db key to have
values that will match here)...
echo time()." seconds have passed<br>";
$min = (time() - (time() % 60)) / 60;
echo $min." minutes have passed<br>";
$hour = ($min - ($min % 60)) / 60;
echo $hour." hours have passed<br>";
$day = ($hour - ($hour % 24)) / 24;
echo $day." days have passed<br>";
----
Server IP: 69.147.83.197
Probable Submitter: 216.235.103.185
----
Manual Page -- http://www.php.net/manual/en/function.time.php
Edit -- https://master.php.net/note/edit/99730
Del: integrated -- https://master.php.net/note/delete/99730/integrated
Del: useless -- https://master.php.net/note/delete/99730/useless
Del: bad code -- https://master.php.net/note/delete/99730/bad+code
Del: spam -- https://master.php.net/note/delete/99730/spam
Del: non-english -- https://master.php.net/note/delete/99730/non-english
Del: in docs -- https://master.php.net/note/delete/99730/in+docs
Del: other reasons-- https://master.php.net/note/delete/99730
Reject -- https://master.php.net/note/reject/99730
Search -- https://master.php.net/manage/user-notes.php