How do I test date format patterns online?
Enter a date format pattern (strftime, date-fns/Unicode, Go, or Java style) and see the formatted output for any date in real time. The tool shows a token reference table with all available format specifiers. Choose from common presets like ISO 8601 or RFC 2822. Everything runs in your browser.
Format: %Y-%m-%d %H:%M:%S Date: March 19, 2026
2026-03-19 14:30:00
Date Format Tester
Test date format patterns for strftime, date-fns, Moment.js, Go, and Java. Enter a date and pattern to see the formatted output instantly.
Common Formats Preview
| Format | Pattern | Output |
|---|---|---|
| ISO 8601 | %Y-%m-%dT%H:%M:%S%z | 2026-03-21T08:02:47+0000 |
| US Date | %m/%d/%Y | 03/21/2026 |
| EU Date | %d/%m/%Y | 21/03/2026 |
| Full Date + Time | %A, %B %-d, %Y %I:%M %p | Saturday, March 21, 2026 08:02 AM |
| Short Date + Time | %Y-%m-%d %H:%M:%S | 2026-03-21 08:02:47 |
| Time Only (12h) | %I:%M:%S %p | 08:02:47 AM |
| Time Only (24h) | %H:%M:%S | 08:02:47 |
| RFC 2822 | %a, %d %b %Y %H:%M:%S %z | Sat, 21 Mar 2026 08:02:47 +0000 |
Click a row to use that pattern
Token Reference — strftime (Python, PHP, Ruby)
| Token | Description | Example |
|---|---|---|
| %Y | 4-digit year | 2026 |
| %y | 2-digit year | 26 |
| %m | Month (01–12) | 03 |
| %-m | Month (1–12) | 3 |
| %B | Full month name | March |
| %b | Abbreviated month | Mar |
| %d | Day (01–31) | 18 |
| %-d | Day (1–31) | 18 |
| %A | Full weekday | Wednesday |
| %a | Abbreviated weekday | Wed |
| %H | Hour 24h (00–23) | 14 |
| %I | Hour 12h (01–12) | 02 |
| %M | Minute (00–59) | 05 |
| %S | Second (00–59) | 09 |
| %p | AM/PM | PM |
| %z | UTC offset | +0100 |
| %Z | Timezone name | EST |
| %j | Day of year (001–366) | 077 |
| %w | Weekday (0=Sun) | 3 |
| %s | Unix timestamp | 1774070400 |
| %% | Literal % | % |
Quick Reference
strftime — Python (datetime.strftime), PHP (strftime), Ruby (Time#strftime), C. Unicode — date-fns (format), Moment.js, Day.js. Go — uses reference time Mon Jan 2 15:04:05 MST 2006. Java — SimpleDateFormat, Kotlin, Scala.
Tips & Best Practices
ISO 8601 (YYYY-MM-DD) is the only unambiguous date format
01/02/03 means January 2 in the US, February 1 in Europe, and February 3 in some Asian countries. ISO 8601 (2024-01-02) is internationally unambiguous and sorts correctly as a string. Always use it for APIs, logs, and data exchange.
JavaScript's Date.parse() behavior varies across browsers
Date.parse('2024-01-15') returns different results depending on whether a time zone is included. Without a timezone suffix, some browsers treat it as UTC, others as local time. Always include timezone: '2024-01-15T00:00:00Z' for UTC.
Go's time format uses a reference date, not symbols
Go formats dates using the reference time 'Mon Jan 2 15:04:05 MST 2006' — each component has a specific value (Jan=1, 2=day, 15=3PM, 04=minute, 05=second, 2006=year). It's unintuitive at first but eliminates ambiguity in format strings.
Timezone-unaware dates cause authentication and billing bugs
A subscription that 'expires on January 15' — in which timezone? A user in UTC+12 loses access 12 hours before a user in UTC-12. Always store timestamps in UTC with timezone info, and convert to local time only for display.