Sometimes, we want to get today’s date in Google Apps Script with JavaScript.
In this article, we’ll look at how to get today’s date in Google Apps Script with JavaScript.
How to get today’s date in Google Apps Script with JavaScript?
To get today’s date in Google Apps Script with JavaScript, we use the Utilities.formatDate
method.
For instance, we write
const today = Utilities.formatDate(new Date(), "GMT+1", "dd/MM/yyyy");
to call the Utilities.formatDate
to get today’s date in dd/MM/yyyy format with time zone GMT+1 as a string.
Conclusion
To get today’s date in Google Apps Script with JavaScript, we use the Utilities.formatDate
method.