Hi,
Can you tell how do I add time, i.e.
Start time ----------------- End Time ---------------- ---- Total
12:00:09 PM ---------------- 12:07:59 PM ---------------- 0:07:50
12:10:32 PM ---------------- 2:25:04 PM ---------------- 1:34:32
There are many more records and I want to add the Totals, including the seconds, minutes and hours.
Can anyone suggest how I could do that using PHP.
Thanks
Adding Time
Moderator: General Moderators
Depending on the way you require this to work you may be able to use the function mktime.
http://uk.php.net/mktime
http://uk.php.net/mktime
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
convert them to unix timestamps, add them up, divide it back out into the apporpriate format if you are using php to do it. If you're using a database, they often have date/time interaction functions. For instance, MySQL has ADDTIME(). Note that you shouldn't use 12 hour format times with MySQL..