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

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...
Build Your Own AI Writer in Google Sheets

Build Your Own AI Writer in Google Sheets

Create your own AI writer with these google sheets tips and tricks and c...
Can I Automatically Rename a Sheet based on a Date?

Can I Automatically Rename a Sheet based on a Date?

Change the title of a spreadsheet from within a cell in the spreadsheet.
Create an Automated Task List

Create an Automated Task List

I've created simple automations to make an awesome automatic task list. ...
Creating A Dark Mode Theme | Announcing Dark Habits

Creating A Dark Mode Theme | Announcing Dark Habits

Build a habit tracker in dark mode. Learn how to use emojis and checkbox...
Daily Writer's Word Count Tracker

Daily Writer's Word Count Tracker

Walk through creating an awesome automatic word count tracker that's eas...
Deep Inside Dark Habits Google Script

Deep Inside Dark Habits Google Script

Go inside this apps script and sheet. See how it's designed and created.
Email Myself a Daily Random Motivational Quote

Email Myself a Daily Random Motivational Quote

Quickly make a daily email to myself with a motivational quote.
Embed Quote and Author to Daily Quote Website

Embed Quote and Author to Daily Quote Website

Step by step tutorial to update random quote site to show both Quote and...
Every Google Drive File Created in Last 24 Hours

Every Google Drive File Created in Last 24 Hours

Create a simple report in a Google Sheet that documents every file in yo...
How To Duplicate a Tab and Move it to the End in Google Sheets

How To Duplicate a Tab and Move it to the End in Google Sheets

Learn how to automate creating a template and moving the tab to the far ...
MicroManager: Hourly Email Reminders

MicroManager: Hourly Email Reminders

I'll show you how to set up a super powered checklist that can act like ...
Richard Asks: Copy Template Tab and Rename to Date Every Week

Richard Asks: Copy Template Tab and Rename to Date Every Week

Member Richard asks this question. Answer: use Google Script and a Trigger.
Send Better Email When Google Form Filled Out

Send Better Email When Google Form Filled Out

Find out how to email all the form entries each time your form is filled...
Timestamp When Done (With Code)

Timestamp When Done (With Code)

Automatically create a timestamp when a certain cell is marked as Done. ...
Ultimate Prompt Writer and Prompt Rater

Ultimate Prompt Writer and Prompt Rater

Create a chat interface inside of Google Sheets using GPT-4. Insert rows...
Visicalc 2023 Design Walkthrough

Visicalc 2023 Design Walkthrough

Design walkthrough of VisiCalc 2023. Watch this if you'd like to see the...
Visicalc 2023 Quick Walkthrough

Visicalc 2023 Quick Walkthrough

This is a fun template I created for April 1st. Take a quick walk throug...

Related blog posts

Written guides about Utilities.formatDate().

Browse the blog