class Utilities method .formatDate()

Utilities is the Apps Script service.

.formatDate() is the method name you will see after a dot in your code.

What it does

Formats a date using a pattern and time zone.

Why it's used

  • Turn a JavaScript date into a readable string for emails or cells.
  • Match a consistent date format across exports.

Common errors

  • Forgetting parentheses on formatDate. Write Utilities.formatDate(), not Utilities.formatDate or formatDate by itself.
  • Skipping dots between chained calls. Each step needs a dot, like Utilities.formatDate().
  • Adding spaces where they do not belong. Write Utilities.formatDate(), not Utilities .formatDate(), Utilities.formatDate (), or Utilities . formatDate().
  • Wrong capitalization. Use Utilities and formatDate, not utilities or formatdate.

Explore

Related methods

3 Better Sheets tutorials

Add NPS to Your Google Site

Add NPS to Your Google Site

Create buttons on your Google Site to get an NPS, or Net Promoter Score ...
Americano Tournament Template With Four Automations

Americano Tournament Template With Four Automations

Created a tournament template with 4 automations. So tabs can be copied ...
Automatically Backup a Spreadsheet

Automatically Backup a Spreadsheet

Make a copy and rename to BACKUP plus the Date of the backup. Execute th...

Related blog posts

Written guides about Utilities.formatDate().

Browse the blog