Java script to calculate total hours in 12 hour format.
OK, so I know how I would do this easily in Excel, but scripting is still beyond me.
So the equation is fairly simple:
Time In Time out Total Hours
6:00 4:00 10
So the Time in will always be AM and the time Time out will always be PM. I'm not adding AM or PM to either of the boxes, Just numbers and colon as the AM and PM are appropriately assumed for this specific paper.
In Excel I would run it as Time In - (time out + 12:00) = X = Total Hours...... In this case 6 - (4 + 12) = 10 Hours.
Basically automatically changing the Time out to Military and then calculating the total hours without visibly changing the Time out to 24h.
Any help to script that would be much appreciated. There is 1 time in, 1 time out, and 1 total hours for 31 days of the month. So if underlining the part of the script I would need to change for each form fillable box wouldnt be too much to ask for, I would much appreciate it. Wish they had a way that Excel formulas would work in a PDF. That would make things super easy for me.
