Skip to main content
joshuab76782683
Participating Frequently
March 21, 2019
Question

Timeshet calculation with multiple workers

  • March 21, 2019
  • 1 reply
  • 342 views

I am trying to compute a form that my foreman can fill out onsite. I have 4 columns, Start, Finish, Number of Workers, and Total Time.

How can the total time column to give a sum of every ones hours.

example total hours = (Finish-Start)*Number of workers.

Something that yields like the table below.

Thanks

Josh

StartFinishNumber of workersTotal Time
9:0017:003

24

9:0016:00214
This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 21, 2019

Time calculations are not so simple. They were discussed on these forums many times in the past, though, so try searching around.

Here are some good tutorials on the subject:

https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript

https://acrobatusers.com/tutorials/working-with-date-and-time-in-acrobat-javascript-part-2

https://acrobatusers.com/tutorials/working-date-and-time-acrobat-javascript-part-3-3

If you're interested I've developed a (paid-for) tool that allows you to set up this kind of calculation without having to write any code. You just enter the fields' names and their time-pattern and it does the rest for you. You can find it here: Custom-made Adobe Scripts: Acrobat -- Calculate Time Differences in a Worksheet

In your case I would recommend using a set of hidden field for the time difference, and then multiply their values by the number of workers to get the total time. However, it can be done even without those fields, but would require a bit more complicated script.