Categories
JavaScript Answers

How to get today’s date in Google Apps Script with JavaScript?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *