Re: calculate 2 times
| From: | Martin Thoma | Date: | Wed, 23 Jan 2002 13:10:16 +0000 |
| Subject: | Re: calculate 2 times | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81677@lists.php.net to get a copy of this message | ||
Hi!
Use explode(";", databasevalue) to split the time you get from the database into
hour, minute, second. Use mktime then to make a unix-timestamp out of it (its
equal to "seconds since 1.1.1970). Do this with both times, and then just
calculate the difference with difference = unixTimeEnd-unixTimeStart. Then use
date to display the difference in the format you want.
Martin