Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!

Converting English Months to French in ACC


Level 2


First run at ACC here, and trying to convert the current date into French months:


<%= formatDate(new Date(), "%D %Bi %Y") %>,


So instead of 20 July 2020, i would it to say 20 juillet 2020

11 Replies


Community Advisor

Hello @cslackl1 ,


You can use moment.js in your workflow to achieve this.


Just download the moment.js library (from here). Then upload it in Administration > Configuration > JavaScript Codes


Then in your workflow you can use this code.

var myDate=formatDate(new Date(), "%D %Bi %Y");
var frenchDate=moment(myDate, 'DDD MMMM YYYY', 'fr');

More Information on date formatting is available here:,valid%20dates%20over%20invalid%20ones.

Let me know if that works.


Level 2
Thank you! As i dont have access to admin panel yet, I cannot try this but i have asked my admin to load it.


Level 2
Hey Manoj, so i got the lib installed, and im not getting an error, but im not sure how to display the date now?, I have added that script inside the email.


Level 2

Hey Jonathon, Thanks!
Hey! My problem is the correct syntax, as i am new to eJS (coming from Freemarker) i cant seem to get it right:


<%= formatDate(toLocaleDateString('fr-CA), "%D %Bl, %Y") %>


Doesnt seem to work, but chances are im not coding it correctly.


Level 2
Hey! My problem is the correct syntax, as i am new to eJS (coming from Freemarker) i cant seem to get it right:


Community Advisor

Use the below, remove any js libs installed for this:

new Date().toLocaleDateString('fr-CA', {
  year: 'numeric',
  month: 'long',
  day: 'numeric'




Level 2

Hey Jon,


I added that script to my personalization block, and called that into my delivery, and i am getting this error:

Error while evaluating document

JST-310000 Error while compiling script 'content htmlContent' line 20: missing ) after argument list (line=' }); ' token='; ').
SCR-160032 Javascript&colon; error while compiling script 'content htmlContent'.
JST-310007 Unable to compile script (content htmlContent).

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now