Date Formatter Task¶
Overview¶
The Date Formatter Task parses, formats, and manipulates dates and times. Use it to convert between timezones, calculate date differences, add/subtract time periods, or format dates for display.
When to use this task:
- Format dates for different regions
- Convert between timezones
- Calculate date differences
- Add/subtract days, weeks, months
- Parse dates from various formats
- Determine day of week
- Calculate business days
- Format for databases or APIs
Key Features:
- Multiple date format outputs
- Timezone conversion
- Date arithmetic (add/subtract)
- Parse various input formats
- Relative dates (yesterday, next week)
- Day/month/year extraction
- Business day calculations
- ISO 8601 support
Quick Start¶
- Add Date Formatter task
- Input date to format
- Select output format
- Configure timezone if needed
- Test
- Save
Simple Example:
Common Formats¶
Display Formats¶
| Format | Output Example | Use Case |
|---|---|---|
MM/DD/YYYY | 02/08/2026 | US display |
DD/MM/YYYY | 08/02/2026 | International |
MMMM DD, YYYY | February 08, 2026 | Formal |
MMM D, YY | Feb 8, 26 | Compact |
YYYY-MM-DD | 2026-02-08 | Database |
ddd, MMM D | Sat, Feb 8 | Calendar |
Time Formats¶
| Format | Output Example |
|---|---|
HH:mm:ss | 14:30:00 |
hh:mm A | 02:30 PM |
HH:mm | 14:30 |
Combined¶
| Format | Output Example |
|---|---|
YYYY-MM-DD HH:mm:ss | 2026-02-08 14:30:00 |
MMM D, YYYY at h:mm A | Feb 8, 2026 at 2:30 PM |
| ISO 8601 | 2026-02-08T14:30:00Z |
Configuration¶
Basic Formatting¶
Input Date: {{task_49001_submitted_date}}
Output Format: MMMM DD, YYYY
Timezone: (optional)
Output: {{task_26001_formatted}}
Timezone Conversion¶
Input Date: {{task_46001_timestamp}}
Input Timezone: UTC
Output Timezone: America/New_York
Output Format: YYYY-MM-DD HH:mm:ss
Output: {{task_26001_formatted}}
Common Timezones: - UTC - Coordinated Universal Time - America/New_York - US Eastern - America/Chicago - US Central - America/Denver - US Mountain - America/Los_Angeles - US Pacific - Europe/London - UK - Europe/Paris - Central European - Asia/Tokyo - Japan - Australia/Sydney - Australia - Africa/Johannesburg - South Africa
Date Arithmetic¶
Add time:
Operation: Add
Input: {{task_48001_current_date}}
Add: 7 days
Output: {{task_26001_result}} = date 7 days from now
Subtract time:
Operation: Subtract
Input: {{task_49001_due_date}}
Subtract: 3 days
Output: {{task_26001_result}} = reminder date
Units: days, weeks, months, years, hours, minutes
Extract Components¶
Input: 2026-02-08
Extract: Day of Week
Outputs:
{{task_26001_day_name}} = Saturday
{{task_26001_day_number}} = 6 (0=Sunday)
{{task_26001_month_name}} = February
{{task_26001_month_number}} = 2
{{task_26001_year}} = 2026
{{task_26001_day_of_month}} = 8
Calculate Difference¶
Operation: Difference
Start Date: {{task_47001_created_date}}
End Date: {{task_48001_current_date}}
Unit: days
Output: {{task_26001_difference}} = 15
Real-World Examples¶
Example 1: Invoice Due Date Calculator¶
Workflow: 1. CRM Trigger - Order created 2. Date Formatter - Calculate due date (30 days) 3. Date Formatter - Format invoice date 4. PDF - Generate invoice
Calculate Due Date:
Operation: Add
Input: {{task_48001_current_date}}
Add: 30 days
Format: MM/DD/YYYY
Output: {{task_26001_formatted}}
Format Invoice Date:
Use in PDF:
Example 2: Birthday Email Automation¶
Workflow: 1. Client Date Trigger - Birthday today 2. Date Formatter - Calculate age 3. Email - Send birthday wishes
Calculate Age:
Operation: Difference
Start Date: {{task_51001_date_of_birth}}
End Date: {{task_48001_current_date}}
Unit: years
Output: {{task_26001_difference}} = age
Email:
To: {{task_51001_email}}
Subject: Happy {{task_26001_difference}}th Birthday!
Hi {{task_51001_first_name}},
Wishing you a wonderful {{task_26001_difference}}th birthday! 🎂
Best wishes,
The Team
Example 3: Event Reminder System¶
Workflow: 1. Timer Trigger - Daily check 2. MySQL Query - Get upcoming events 3. Loop - For each event 4. Date Formatter - Calculate days until event 5. If Task - Check if within reminder window 6. Email - Send reminder
Calculate Days Until Event:
Operation: Difference
Start Date: {{task_48001_current_date}}
End Date: {{task_29001_event_date}}
Unit: days
Output: {{task_26001_difference}}
If Task:
Email:
Subject: Reminder: {{task_29001_event_name}} in {{task_26001_difference}} days
Your event "{{task_29001_event_name}}" is coming up in {{task_26001_difference}} days!
Date: {{task_29001_event_date}}
Time: {{task_29001_event_time}}
Example 4: Subscription Renewal Dates¶
Workflow: 1. CRM Trigger - Subscription created 2. Date Formatter - Calculate renewal date 3. Date Formatter - Calculate reminder dates 4. Edit Client - Store dates
Calculate Annual Renewal:
Operation: Add
Input: {{task_47001_start_date}}
Add: 1 year
Format: YYYY-MM-DD
Output: {{task_26001_formatted}}
Calculate 30-Day Reminder:
Operation: Subtract
Input: {{task_26001_formatted}}
Subtract: 30 days
Format: YYYY-MM-DD
Output: {{task_14002_formatted}}
Edit Client:
Contact ID: {{task_47001_contact_id}}
Update: custom_renewal_date = {{task_26001_formatted}}
Update: custom_reminder_date = {{task_14002_formatted}}
Output Fields¶
| Field | Description | Example |
|---|---|---|
task_26001_formatted | Formatted date string | February 08, 2026 |
task_26001_result | Result of calculation | 2026-03-08 |
task_26001_difference | Difference in specified units | 15 |
task_26001_day_name | Day of week name | Saturday |
task_26001_day_number | Day of week (0-6) | 6 |
task_26001_month_name | Month name | February |
task_26001_month_number | Month (1-12) | 2 |
task_26001_year | Year | 2026 |
task_26001_unix_timestamp | Unix timestamp | 1770566400 |
task_26001_iso8601 | ISO 8601 format | 2026-02-08T00:00:00Z |
Best Practices¶
Timezone Handling¶
- Store in UTC - Always store dates in UTC in database
- Convert for display - Format to user's timezone
- Be explicit - Specify timezone in configuration
- Test across zones - Verify with different timezones
- Document assumptions - Note timezone expectations
Date Validation¶
- Check before format - Verify date exists
- Handle invalid dates - Provide defaults
- Parse carefully - Specify expected input format
- Test edge cases - Leap years, month ends
- Validate ranges - Ensure dates are reasonable
Performance¶
- Format once - Store formatted value in Variable
- Minimize calculations - Do math in Code task when complex
- Use relative dates - When possible, use "X days ago"
- Cache current date - Reference Timer Trigger date
- Batch operations - Process dates outside loops when possible
Troubleshooting¶
Invalid Date Error¶
Causes: - Input is not a date - Date format not recognized - Null/empty input
Solutions: - Verify input field has date - Specify input format - Provide default date
Timezone Issues¶
Issue: Date shifts by hours
Cause: Timezone conversion unexpected
Solution: - Explicitly set input/output timezones - Store dates in UTC - Use ISO 8601 format
Wrong Date Calculation¶
Issue: Adding 1 month gives unexpected date
Note: Month addition respects month length - Jan 31 + 1 month = Feb 28/29 (not March 3)
Solution: Be aware of month-end behavior
Format Not Working¶
Issue: Output doesn't match format string
Check: - Format string syntax correct? - Using proper tokens (YYYY not yyyy)? - Date has all components needed?
Common tokens: - YYYY = 4-digit year - MM = 2-digit month - DD = 2-digit day - HH = 24-hour format - hh = 12-hour format
Frequently Asked Questions¶
What date formats can I parse?¶
Most common formats: - ISO 8601 (YYYY-MM-DD) - US format (MM/DD/YYYY) - European (DD/MM/YYYY) - Timestamps (Unix, JavaScript)
How to handle "2 days ago"?¶
Use relative date in Timer Trigger or calculate with Date Formatter.
Can I calculate business days?¶
Yes, use Business Days option to exclude weekends/holidays.
What about daylight saving time?¶
Timezone conversions automatically handle DST.
How to compare two dates?¶
Use Difference operation or If task with date comparison.
Can I format multiple dates at once?¶
No, use separate Date Formatter task for each date or Loop task.
Related Tasks¶
- Timer Trigger - Current date/time
- Client Date Trigger - Date-based triggers
- Formatter - General formatting
- Code Task - Complex date logic
- If Task - Date comparisons