Re: TIME CALCULATION IN PHP
| From: | W. D. | Date: | Wed, 28 Jan 2004 06:21:00 +0000 |
| Subject: | Re: TIME CALCULATION IN PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32670@lists.php.net to get a copy of this message | ||
At 23:44 1/27/2004, Delz, wrote:
>Hi All,
>
>How do i calculate time in PHP lets say I have this example
>
>Input Time Started : 9:00
>Input Time Ended : 13:00
>
>Answer
>Total Time in Hours : 4
>Total Time in Minutes : 240
What happens when they start at 23:59 and end at 01:30? This
may never happen in your situation, but it's always wise to
plan for this possibility.
UnixTime has dates, time in hours mins & secs so you can
add and subtract easily.
There are a number of functions in PHP that allow you to
manipulate these. For more info:
http://us4.php.net/datetime
http://www.Google.com/search?q=add+subtract+dates+times+php+examples
Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/