Posted by Toby A Inkster on 03/24/07 00:48
Krustov wrote:
> 23:50
> 01:40
>
> 110 minutes running time
<?php
$start = '23:50';
$end = '01:40';
list($start_h, $start_m) = explode(':', $start);
$start = (60 * $start_h) + $start_m;
list($end_h, $end_m ) = explode(':', $end);
$end = (60 * $end_h) + $end_m;
$length = $end - $start;
if ($length < 0)
$length += 1440;
echo "Length is $length minutes.\n";
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|