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]
|