Given a series of hours, minutes, and seconds (ex: 01:30:00 or 00:30:00), I would like to add up each and convert the sum to seconds.
For example, if the total time is 02:30:00, the total time should be in seconds.
Thanks!
$timestr = '00:30:00';
$parts = explode(':', $timestr);
$seconds = ($parts[0] * 60 * 60) + ($parts[1] * 60) + $parts[2];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With