Reply to Re: How to calculate the running time

Your name:

Reply:


Posted by iktorn on 03/23/07 20:58

Krustov napisał(a):
> <comp.lang.php>
> <iktorn>
> <Fri, 23 Mar 2007 20:51:52 +0100>
> <eu1b3e$85c$1@news.task.gda.pl>
>
>> 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 :)
>>
>
> At least you gave it crack :-)
>
> 18:05
> 21:10
>
> 23:20
> 01:15
>
> etc
>
> The ideal solution would be one that takes two unknown values to produce
> a end result value running time like 100 minutes .

function f($start,$end){
return ($start>$end?(strtotime("+1 day
".$end)-strtotime($start)):(strtotime($end)-strtotime($start)))/60;
}

;)

--
Wiktor Walc
http://phpfreelancer.net

[Back to original 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

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