Date Subtraction
| From: | Christopher J. Crane | Date: | Mon, 23 Dec 2002 21:29:16 +0000 |
| Subject: | Date Subtraction | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-129229@lists.php.net to get a copy of this message | ||
I have two periods in time from a Cisco router that I would like to find the
difference in seconds. I am not sure the best way to do this since it is not
a date, but rather an amount of time since last reset.
Here is the numbers
181 days, 7:11:06.66
//stands for 181 days, 7 hours, 11 minutes, 6.66 seconds.
The next is
181 days, 7:16:6.75
//stands for 181 days, 7 hours, 16 minutes, 7.75 seconds.
I would probably shave off the .66 and .75 seconds while it was still a
string. It may be faster to round when it's in seconds, I really don't know.
Then what do I do?
I was thinking of using strtotime(); but because it's not really a date, I
am at a loss for what to do.
Any help with this would be great.