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

Displaying the time in 12-hour format when the document is printed

New Here ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hi,

 

I am having an issue with using Javascript on Acrobat Pro to display the date and time that the document was printed. The Javascript code that I am using is:

 

this.getField("PrintDate").value = "Printed on: " + util.printd("mmm d, yyyy hh:MM tt", new Date());

 

When I use this code on the "Will save" action, the time prints correctly in a 12-h format with the am/pm. However, when I use the same code on the "Will print" action, the 'tt' become a 'P' no matter if it is morning or afternoon. I have attached a document containing the output that I get from my code when I save the file, then print it using Google chrome. Does anyone know why the code is not working for the "Will print" action?

 

Thank you in advance

Marie

TOPICS
How to

Views

1.3K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , May 30, 2021 May 30, 2021

Report the issue to the developers of the Chrome PDF plugin.

Votes

Translate

Translate
Community Expert ,
May 29, 2021 May 29, 2021

Copy link to clipboard

Copied

What happens when you print the file with Acrobat Reader or Adobe Acrobat?

Votes

Translate

Translate

Report

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
New Here ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

It works fine. I tried to print the file with different browsers and it didn't work, so I'm assuming the issue is with the browsers. Thank you.

Votes

Translate

Translate

Report

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 ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

Report the issue to the developers of the Chrome PDF plugin.

Votes

Translate

Translate

Report

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
New Here ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

LATEST

I attempted this on various browsers and got the same result so I think the issue is present on most browsers. Thank you for the advice, I will contact them.

Votes

Translate

Translate

Report

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