Skip to main content
Participant
May 29, 2019
Question

Calculate Duration

  • May 29, 2019
  • 1 reply
  • 413 views

Hi

I am having a pdf form that includes three cells:

start Time

end Time

Duration

The user will enter the start time and end time in HH:MM and the file will calculate the duration In HH:MM

I want your help in building a JavaScript code because I need the file but my skills are basic in JavaScrip. Name of the cells are same as mentioned on the top.

Thanks in advance.

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
May 29, 2019

You can start by reading these articles on the Date object, which is what you'll need for calculating duration.

https://acrobatusers.com/tutorials/date_time_part1

https://acrobatusers.com/tutorials/date_time_part2

The example in the second article shows how to calculate the time between two times.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often