Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Working with dates

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Working with dates

Postby stephenl » Tue Dec 31, 2013 3:15 am

Hello

I'm looking for advice and suggestions on how to deal with the following problem -

Project - Clock in/out (with break periods)

I need to calculate the number of minutes between 2 date/times taking into account breaks, ie

break1 09:30:00 - 15mins
break2 12:30:00 - 30mins
break3 15:45:00 - 10mins

If the user clocks in at 8:00 and clocks out at 9:15 the period recorded should be 75mins
however
If the user clocks in at 8:00 and clocks out at 10:00 the period recorded should be 105mins (15 mins deducted for break 1)
or
If the user clocks in at 11:00 and clocks out at 17:00 the period recorded should be 320mins (40 mins deducted for break 2 + break 3)
etc, etc....

The user can clock in/out at any time, however if the clocked in time crosses a break period, this period needs to be deducted

suggestions appreciated
Thank you
stephenl
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jan 10, 2012 12:16 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.