Skip to main content
Participant
October 28, 2022
Answered

Custom Date in different languages

  • October 28, 2022
  • 2 replies
  • 1735 views

Hi all! 🙂

 

I'm trying to populate a field with an automatic date.

Since I need different PDF's with different languages I thought an array specifying the name of the month would be an idea. Unfortunatelly I can't seem to find any solutions.

 
The one thread I found with f.value = util.printd("mmmm d, yyyy", newDate()); worked, but only in english 😕😕 

 

has someone an idea how I could do it?

I'm using Adobe Acrobat Pro DC

 

thank you in advance for your help 🙂 

This topic has been closed for replies.
Correct answer bebarth

Here is an example with several other languages.

@+

 

2 replies

JR Boulay
Community Expert
Community Expert
October 30, 2022

You can use this free Date picker, it works with 28 languages:

https://www.abracadabrapdf.net/utilitaires/utilities-in-english/magicdate-picker/

Acrobate du PDF, InDesigner et Photoshopographe
bebarth
Community Expert
Community Expert
October 28, 2022

Hi,

If you write:

 

event.value=util.printd("date(en){MMMM}",new Date(),true);

 

you will get the month in English, but if you write:

 

event.value=util.printd("date(fr){MMMM}",new Date(),true);

 

you will get it in French. So if you write:

 

theLanguage=this.app.language.substr(0,2).toLowerCase();
event.value=util.printd("date("+theLanguage+"){MMMM}",new Date(),true);

 

you will get the month in the language of your Acrobat application.

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#language

...this is at a capital letter the same thing as:

 

event.value=util.printd("mmmm",new Date());

 

@+

bebarth
Community Expert
bebarthCommunity ExpertCorrect answer
Community Expert
October 29, 2022

Here is an example with several other languages.

@+

 

Participant
October 31, 2022

Thank you so much😁 this really helped and gave me the solution to my problem 😁👏🥳