|
Posted by iktorn on 03/23/07 19:51
Krustov napisał(a):
> The start and end times for a tv show or film .
> 17:50
> 18:30
>
> 40 minutes running time
>
> 23:50
> 00:30
>
> 40 minutes running time
>
> 23:50
> 01:40
>
> 110 minutes running time
>
>
> While i could write the code in a luddite type of fashion and it would
> work fine and stuff - is there a one or two line solution that would do
> the same job ? .
echo (strtotime("18:30")-strtotime("17:50"))/60;
echo (strtotime("+1 days 1:40")-strtotime("23:50"))/60;
at least I don't know any better solution :)
--
Wiktor Walc
http://phpfreelancer.net
Navigation:
[Reply to this message]
|