Formats a date using a pattern and time zone.
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
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.
Snippets using this method
- Ultimate Prompt Writer and Prompt Rater
- Visicalc 2023 Design Walkthrough
- Visicalc 2023 Quick Walkthrough
- Send Better Email When Google Form Filled Out
- Timestamp When Done (With Code)
- Richard Asks: Copy Template Tab and Rename to Date Every Week
- MicroManager: Hourly Email Reminders
- How To Duplicate a Tab and Move it to the End in Google Sheets
- Daily Writer's Word Count Tracker
- Every Google Drive File Created in Last 24 Hours
- Embed Quote and Author to Daily Quote Website
- Email Myself a Daily Random Motivational Quote
- Deep Inside Dark Habits Google Script
- Create an Automated Task List
- Can I Automatically Rename a Sheet based on a Date?
- Build Your Own AI Writer in Google Sheets
- Automatically Backup a Spreadsheet
- Add NPS to Your Google Site
- Americano Tournament Template With Four Automations
Explore
Related methods
-
.jsonStringify()
Converts a JavaScript object into a JSON string.
-
.jsonParse()
Parses a JSON string into a JavaScript object.
-
.base64Encode()
Encodes a string or bytes as Base64.
-
.parseCsv()
Parses CSV text into a 2D array of values.
-
.base64Decode()
Decodes a Base64 string back into raw data.
More Apps Script
Better Sheets tutorials
Add NPS to Your Google Site
Americano Tournament Template With Four Automations
Automatically Backup a Spreadsheet
Build Your Own AI Writer in Google Sheets
Can I Automatically Rename a Sheet based on a Date?
Create an Automated Task List
Creating A Dark Mode Theme | Announcing Dark Habits
Daily Writer's Word Count Tracker
Deep Inside Dark Habits Google Script
Email Myself a Daily Random Motivational Quote
Embed Quote and Author to Daily Quote Website
Every Google Drive File Created in Last 24 Hours
How To Duplicate a Tab and Move it to the End in Google Sheets
MicroManager: Hourly Email Reminders
Richard Asks: Copy Template Tab and Rename to Date Every Week
Send Better Email When Google Form Filled Out
Timestamp When Done (With Code)
Ultimate Prompt Writer and Prompt Rater
Visicalc 2023 Design Walkthrough
Related blog posts
Written guides about Utilities.formatDate().
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to Send Google Forms Entries Automatically with Apps Script
Google Forms provides basic email notifications for form submissions, but enhancing these notifications with detailed summaries can significantly improve productivity and response management.
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →