Timestamp Format
Format date/time strings
About This Calculator
Timestamp formatting converts date and time values between human-readable strings and machine formats. Different systems use wildly different date formats (MM/DD/YYYY in the US, DD/MM/YYYY in Europe, YYYY-MM-DD in ISO 8601), and timestamp parsers must handle this variety. The ISO 8601 standard is the unambiguous format recommended for data interchange.
Formula
ISO 8601: YYYY-MM-DDTHH:MM:SS±HH:MM (e.g. 2024-03-16T14:30:00+00:00)
strftime format codes: %Y=4-digit year, %m=month, %d=day, %H=hour, %M=min, %S=sec
Unix timestamp: seconds since 1970-01-01T00:00:00Z
RFC 2822 (email): 'Mon, 16 Mar 2024 14:30:00 +0000'
Example Calculation
Format March 16, 2026 2:30 PM UTC in multiple formats
- ISO 8601: 2026-03-16T14:30:00Z
- US format: 03/16/2026 2:30 PM
- EU format: 16/03/2026 14:30
- Unix timestamp: 1,773,390,600
Same moment expressed in 4 different format conventions
Common Date/Time Format Patterns
| Format | Pattern | Example |
|---|---|---|
| ISO 8601 | YYYY-MM-DDTHH:MM:SSZ | 2026-03-16T14:30:00Z |
| US Date | MM/DD/YYYY | 03/16/2026 |
| EU Date | DD/MM/YYYY | 16/03/2026 |
| Long date | Month DD, YYYY | March 16, 2026 |
| Short date | M/D/YY | 3/16/26 |
| 24-hour time | HH:MM:SS | 14:30:00 |
| 12-hour time | h:MM:SS AM/PM | 2:30:00 PM |
| RFC 2822 | Day, DD Mon YYYY HH:MM:SS +0000 | Mon, 16 Mar 2026 14:30:00 +0000 |
Frequently Asked Questions
What is ISO 8601 and why should I use it?
ISO 8601 is the international standard for date and time representation (YYYY-MM-DD). It is unambiguous — 04/05/06 could be April 5, 2006 or May 4, 2006 or many other dates depending on locale. ISO format sorts correctly alphabetically, is machine-readable, and is internationally unambiguous. Use it for APIs and databases.
What are strftime format codes?
strftime is a C library function for formatting dates, used across Python, Ruby, C, and many other languages. Common codes: %Y (4-digit year), %y (2-digit year), %m (month 01-12), %d (day 01-31), %H (hour 00-23), %I (hour 01-12), %M (minutes), %S (seconds), %p (AM/PM), %Z (timezone name).
What is the difference between UTC and local time in timestamps?
UTC (Coordinated Universal Time) timestamps are timezone-independent and should be stored in databases. The 'Z' suffix (or +00:00) in ISO 8601 indicates UTC. When displaying to users, convert to their local timezone. Storing timestamps in UTC avoids DST bugs and timezone conversion errors.
Why does MM/DD/YYYY cause problems?
MM/DD/YYYY is ambiguous when shared internationally. '04/05/2026' means April 5 in the US but May 4 in Europe. This causes real-world errors in contracts, medical records, and software. The ISO 8601 standard (YYYY-MM-DD) was designed specifically to eliminate this ambiguity.