
1. Re: time sheet Calculate time
gkaiseril Jan 31, 2017 1:54 PM (in response to matures29785352)Have you tired to do the calculations by hand?
11:00 less 8:00 would be 660  480 or 180 minutes (3 hours 0 minutes)
5:00 less 12:00 would be 300  720 or  420 minutes (7 hours 0 minutes)
Then 180 + (420) would be 240 minutes (4 hours0 minutes)
You have to specify whether the hours are before or after Noon. The hours after 12:00pm are 12 hours after the same hours beform 12:00pm. If you were to add 720 (12 hours) to the 5:00 in the afternoon, you would have the correct answer. You need to be able to tell the difference between times before 12:00pm and times after 12:00pm.
Have you looked at using the time format of "hh:MMtt" and using the JavaScript Date object to obtain the minutes since the Epoch date for the 2 time intervals? You will need to provide the date to get the correct results. This approach will also adjust correctly for Day Light Savings time if needed.

2. Re: time sheet Calculate time
JR_Boulay Feb 1, 2017 2:22 AM (in response to gkaiseril)Hi.
Instead of reinventing the wheel you should search "Time sheet" on this forum, there are some nice examples to download around here.

3. Re: time sheet Calculate time
try67 Feb 1, 2017 2:33 AM (in response to matures29785352)If you're interested I've developed a tool that allows you to set up exactly this kind of calculations very easily: Custommade Adobe Scripts: Acrobat  Calculate Time Differences in a Worksheet

4. Re: time sheet Calculate time
matures29785352 Mar 7, 2017 12:05 PM (in response to matures29785352)I was able to get the time to calculate somewhat based on sample time sheet I found on this website but still need help.
I have uploaded my time sheet sample to Drop Box  https://www.dropbox.com/s/ic22gs7rx1h8ny4/Test_Payroll_Sheet.pdf?dl=0
 First scenario shows I am using two extra fields to calculate total hours since I could not figure out how to do that with Javascript.
 Second scenario shows that I was able to figure out calculation for first in/out group then not sure how to add the after break time.
 Third shows that if someone enters start time and skips to out and leave the two boxes in between empty the calculation doesn't work. We have people who do this all the time.
Any help is appreciated.

5. Re: time sheet Calculate time
gkaiseril Mar 8, 2017 12:40 PM (in response to matures29785352)One can use the JavaScript variable statement to hold the results of intermediate calculations or to accumulate the intermediate results until the final result can be computed. Using this approach eliminates the need to use fields to hold the intermediate results.
For scenario three, you need to decide how to handle this situation. In the samples I have posted I do not compute the result for a pair on in and out times unless the start and end times are present. I chose to not add the additional code to verify that all the pairs of entries are added. Most employers do not process timesheets that are not properly completed. If one were to leave the start or end times empty the calculations will tread the empty time value as if it were midnight of the day or if the day were also missing then date and time is assumed to be Midnight January 1, 1970 or the Epoch date for the scripting language and Operating System being used.
Your calculations will work properly if the time interval you are trying to compute includes the time period when there is the change of time for the ending of daylight savings time or summer time.