Re: subtracting 2 time strings
| From: | Christopher Molnar | Date: | Sun, 11 Aug 2002 15:14:19 +0000 |
| Subject: | Re: subtracting 2 time strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112033@lists.php.net to get a copy of this message | ||
Thanks! Worked perfectly!
-Chris
On Sunday, August 11, 2002, at 09:27 AM, Matt wrote:
From: "Christopher Molnar" <molnarc@pandmservices.com> Sent: Saturday, August 10, 2002 11:37 AM Subject: [PHP] subtracting 2 time stringsHelp! I can't find reference to it in the manuals but I need to subtract to time strings. ex: time_in = 11:00 time_out = 13:45 job_time = 2:45Something like: <?php $time_in = "11:00"; $time_out = "13:45" ; $start = strtotime($time_in); $finish = strtotime($time_out); $elapsed = $finish - $start; echo 'Elapsed time was ' . gmdate('H:i:s',$elapsed) . "<br>\n"; ?>