Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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
Acrobat, How to, Troubleshooting

Views

438

Likes

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

Adobe Community Professional , May 30, 2021 May 30, 2021
Report the issue to the developers of the Chrome PDF plugin.

Likes

Translate

Translate
Adobe Community Professional ,
May 29, 2021 May 29, 2021

Copy link to clipboard

Copied

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

Likes

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.

Likes

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

Copy link to clipboard

Copied

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

Likes

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.

Likes

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