datetime - Subtract time in PHP -


Now I am looking for an answer for a few hours, but I can not find one.

I'm writing simple script User Setting Start Time, and End Time So for example, a person is working from 8:00 to 16:00. How can I reduce this time to see how long the person is working?

I was experimenting with strtotime (); But without success ...

is a little good:

 $ A = New date time ('08: 00 '); $ B = new date time ('16: 00'); $ Interval = $ a-> Different ($ B); Rebound $ Lag- & gt; Format ("% H");  

This will give you a difference in the hours.

Comments