Finding the night differential of two time


I have this two variable:


$time_in = 21:00:00;  $time_out = 05:00:00;  


I just want to know how I should compute the number of hours of night   differential:


Night differential time are:

22:00:00 - 06:00:00


I just want to know if you could suggest anything that can help me for   this if their is a function for this or should I use manually compute   it?


I can not understand properly what you really want to do.

I got this conclusion as I understood

If you use 24-hour time format then specify the date with time