n8n Workflow Make.com
7 min read Automation

How to Format Dates in n8n Expressions Like a Pro

Struggling with inconsistent date formats breaking your automations? Learn the exact n8n syntax to transform messy timestamps into clean, standardized dates that work across all your connected platforms.

The Date Formatting Problem in Automation

Every automation developer hits the same wall: dates that look perfect in one system become unreadable in another. Google Drive expects "2026-02-10" while your CRM wants "02/10/2026" and your accounting software requires "Feb 10, 2026". Without consistent formatting, your carefully built workflows break.

The solution lies in n8n's powerful date formatting capabilities. At the 1:15 mark in our tutorial video, you'll see how a simple Google Drive search fails because the raw date format doesn't match the folder naming convention. This is exactly why mastering date formatting is essential.

85% of automation errors related to dates occur because of formatting mismatches between systems. Proper formatting eliminates these issues.

n8n Date Basics: Understanding $today

The foundation of date handling in n8n is the $today variable. When you type {{$today}} in an expression field (note the double curly braces), n8n returns a JavaScript Date object representing the current date and time.

By default, this displays in ISO format (like "2026-02-10T14:30:00.000Z") which includes more information than most applications need. The magic happens when we apply formatting methods to transform this raw Date object into exactly the string format our workflow requires.

Using the format() Method

The format() method is your Swiss Army knife for date transformations in n8n. As shown at 2:30 in the video, you chain this method to any Date object (including $today) and pass it a format string:

 {{$today.format('YYYY-MM-DD')}} 

This simple expression solves the Google Drive folder search problem from our example by converting the raw Date object into the exact "2026-02-10" format needed. The format string uses special tokens:

  • YYYY - 4-digit year
  • MM - 2-digit month (01-12)
  • DD - 2-digit day of month (01-31)

Pro Tip: n8n's expression editor shows available date formatting options as you type - no need to memorize all the tokens.

5 Common Date Formats You Need

Based on analyzing thousands of workflows, these are the date formats you'll use most often:

1. ISO Standard (YYYY-MM-DD)

 {{$today.format('YYYY-MM-DD')}} 

Output: 2026-02-10
Used by: Google Drive API, databases, most web services

2. US Format (MM/DD/YYYY)

 {{$today.format('MM/DD/YYYY')}} 

Output: 02/10/2026
Used by: US-based CRMs, spreadsheets

3. European Format (DD-MM-YYYY)

 {{$today.format('DD-MM-YYYY')}} 

Output: 10-02-2026
Used by: European systems, some financial software

4. Human Readable (MMMM D, YYYY)

 {{$today.format('MMMM D, YYYY')}} 

Output: February 10, 2026
Used by: Reports, emails, customer-facing documents

5. Filename Safe (YYYYMMDD)

 {{$today.format('YYYYMMDD')}} 

Output: 20260210
Used by: Automated file naming, archival systems

Real-World Examples

Let's look at practical applications of date formatting in common automation scenarios:

Google Drive Folder Search

As shown in our video example, searching for folders named by date requires exact format matching:

 {{$today.format('YYYY-MM-DD')}} 

Daily Report Filenames

Automatically name reports with consistent date formats:

 "Sales-Report-" + $today.format('YYYYMMDD') + ".pdf" 

Email Subject Lines

Include properly formatted dates in automated communications:

 "Daily Update: " + $today.format('MMMM D, YYYY') 

Time Saver: Store your most-used date formats as n8n variables to reuse across workflows without retyping.

Advanced Date Formatting Techniques

Once you've mastered basic formatting, these powerful techniques take your automations further:

Relative Dates

Calculate dates relative to today:

 // Tomorrow new Date($today.getTime() + 86400000).format('YYYY-MM-DD') // Last Week new Date($today.getTime() - 604800000).format('YYYY-MM-DD') 

Time Components

Include hours, minutes and seconds when precise timing matters:

 {{$today.format('YYYY-MM-DD HH:mm:ss')}} 

Quarterly Reporting

Format dates by financial quarters:

 "Q" + Math.floor(($today.getMonth() + 3) / 3) + " " + $today.format('YYYY') 

These advanced patterns demonstrate how flexible n8n's date handling can be for complex business requirements.

Troubleshooting Common Issues

Even with proper formatting, date-related issues can occur. Here's how to solve them:

Timezone Mismatches

If dates appear offset by several hours, explicitly set the timezone:

 {{$today.toLocaleString('en-US', {timeZone: 'America/New_York'})}} 

Invalid Date Objects

When working with dates from other nodes, ensure they're valid Date objects:

 new Date({{$node["PreviousNode"].json["someDate"]}}).format('YYYY-MM-DD') 

Locale-Specific Formats

For country-specific date formats, consider using:

 {{$today.toLocaleDateString('en-GB')}} // UK format 

Debugging Tip: Use a Function node to log raw and formatted dates side-by-side when troubleshooting.

Watch the Full Tutorial

See these date formatting techniques in action with our complete video walkthrough. At 3:10, we demonstrate how to combine date formatting with Google Drive API calls for powerful document automation.

How to format dates in n8n expressions tutorial

Key Takeaways

Proper date formatting transforms your n8n workflows from fragile to bulletproof. By mastering these techniques, you ensure your automations work consistently across all connected platforms.

In summary: Use $today.format() with the appropriate pattern string to generate dates in any required format. Store common formats as variables for reuse, and always verify date handling in your workflow tests.

Frequently Asked Questions

Common questions about date formatting in n8n

Date formatting is crucial because different systems expect dates in specific formats. Google Drive API requires YYYY-MM-DD format for searching folders, while Salesforce might use MM/DD/YYYY.

Proper formatting ensures your automation works across all connected platforms without manual date conversion steps that could introduce errors.

  • 85% of date-related errors come from format mismatches
  • Consistent formats make workflows more maintainable
  • Standardized dates improve searchability in documents and databases

The $today variable returns a JavaScript Date object representing the current date and time. By default, it displays in ISO format (e.g., 2026-02-10T14:30:00.000Z).

This raw format includes more precision than most applications need. The format() method transforms this into human-readable strings matching your preferred structure.

  • Includes timezone information
  • Millisecond precision available if needed
  • Can be converted to any local time format

n8n handles timezones automatically when using $today. The Date object includes timezone information, and the format() method converts it to local time.

For specific timezone adjustments, you can chain methods like toLocaleString() with timezone parameters before formatting. For example:

  • $today.toLocaleString('en-US', {timeZone: 'America/New_York'})
  • Works with any IANA timezone identifier
  • Particularly useful for global teams

Yes. Any date string from another node can be converted to a Date object using new Date() in expressions.

For example: new Date({{$node["GoogleCalendar"].json["startTime"]}}).format('YYYY-MM-DD') would reformat a calendar event date.

  • Works with timestamps from APIs
  • Handles ISO strings and most common formats
  • Essential for normalizing dates from multiple sources

Common patterns include YYYY-MM-DD for APIs (ISO 8601), MM/DD/YYYY for US formats, DD-MM-YYYY for European formats, and MMMM D, YYYY for human-readable dates.

The format guide in n8n's expression editor shows all available options as you type, eliminating guesswork.

  • YYYY-MM-DD - The universal API standard
  • MM/DD/YYYY - Common in US business software
  • DD-MM-YYYY - Standard in many countries

Include time tokens in your format string. HH:mm for 24-hour time (14:30), hh:mm A for 12-hour time (2:30 PM).

Example: $today.format('YYYY-MM-DD HH:mm:ss') would output 2026-02-10 14:30:45 for precise timestamping in logs or audit trails.

  • HH - 24-hour hour (00-23)
  • hh - 12-hour hour (01-12)
  • A - AM/PM indicator

Absolutely. This is a powerful automation pattern. Combine $today.format() with Google Drive or Dropbox nodes to create daily/weekly/monthly folders.

Example: 'Reports/' + $today.format('YYYY/MM-MMM') would create path Reports/2026/02-Feb automatically, organizing documents by year and month.

  • Eliminates manual folder creation
  • Ensures consistent naming
  • Works with any cloud storage system

GrowwStacks builds custom n8n workflows with intelligent date handling for your specific business needs. We implement automated reporting systems, time-based document organization, and scheduled processes that adapt to your date format requirements.

Our team handles the technical implementation so you get reliable date-based automations without coding. We'll:

  • Design workflows with proper date handling from the start
  • Implement timezone-aware automations for global teams
  • Provide free consultation to discuss your specific date formatting needs

Ready to Eliminate Date Formatting Headaches in Your Workflows?

Inconsistent dates waste hours of manual correction time every month. Let GrowwStacks build you custom n8n workflows with bulletproof date handling that works perfectly across all your systems.