PHP:三个时区的时差与时间的关系

I have a problem which I dont know how to solve. Here is example:

$time_start = "13:30";
$time_finish = "03:00";

The worker starts working at 13:30 and finishes next day at 3:00. There are three zones (paid differently): 6:00-13:59,14:00-21:59,22:00-5:59

I need an output in hours which will tell me how many hours the worker was working in which zone. It will take only halfs of hours.

So in this example it would be:

1st zone - 0.5 , 2nd zone - 8 , 3rd zone - 5

I hope its understandable. Thank you very much!

As follows you can calculate the time difference.

$t1=mktime(13,0,0,5,20,2012);
$t2=mktime(13,0,0,5,30,2012);

echo date("H:s:i", ($t2-$t1));

Take a look at http://php.net/manual/es/function.mktime.php