Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to calculate a date on a PDF form by adding two fields together

New Here ,
Nov 10, 2019 Nov 10, 2019

I need to calculate a date on a PDF form. In field "date1" I enter 12/01/13. In field "age1" I enter 7. I would like field "test1" to then display 12/08/13 automatically.
I tried the below code shared by George Kaiser   but not working..... 
Any help is appreciated

TOPICS
Create PDFs , Edit and convert PDFs , PDF forms
7.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 10, 2019 Nov 10, 2019

I do not see any code. Generally one needs to set the date format for the field and the code to the same pattern. One also needs to change the field names to match the form.

 

I would open up the JavaScript console and see if there exist any error messages.

 

I tend to use the full 4 digit year since there are alot of issues when using the 22 digit year. I have been aware of the 2 digit year issue since 1972.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 11, 2019 Nov 11, 2019
LATEST

Here is an article that explains date calculations:

https://acrobatusers.com/tutorials/date_time_part1

 

And here's some really good stuff about date and time handling

https://practicalpdf.com/the-practicalpdf-date-library-for-adobe-acrobat/

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines