Google-apps-script – Google Docs date capitalisation script

dateformattinggoogle docsgoogle-apps-script

I'm using a script that was posted here on Web Applications: Is there a way to insert today’s date into a Google Docs?. I changed the way the date is formatted to: ddMMMyyyy but want 01JAN2015 – the month being capitalized.

Currently my script reads and outputs like 01jan2015.

How do I capitalize the date?

Best Answer

Change this

var date = Utilities.formatDate(new Date(), "GMT", "ddMMMyyyy");

into this

var date = Utilities.formatDate(new Date(), "GMT", "ddMMMyyyy").toUpperCase();

ht to Chris