You are here: Re: How to calculate the running time « PHP Programming Language « IT news, forums, messages
Re: How to calculate the running time

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация