Date/Time Formatter

Format dates and times in various formats and timezones.

Input
Output

                        

About Date/Time Formatter

Convert dates and times between different formats. Format timestamps, dates, and times in various styles.

Common Use Cases:

  • Converting timestamp formats
  • Formatting dates for display
  • Timezone conversions
  • Date parsing and validation

Developers: see the CI/CD & pipeline guide. More tutorials: guides hub · by Nalla.

Date and time formats, ISO 8601, Unix timestamps, and locale formats

Dates are deceptively complex. The same date can be written as 05/06/2024 (May 6 in the US, 5 June in the UK), 06.05.2024 (June 5 in Germany), 2024-05-06 (ISO 8601, always unambiguous), or 1714953600 (Unix timestamp, seconds since 1970-01-01 00:00:00 UTC). Systems that mix these formats produce data that is silently wrong, a bug that only surfaces when two countries' data is merged, often months after the event.

ISO 8601 (YYYY-MM-DD for dates, YYYY-MM-DDTHH:MM:SSZ for timestamps with UTC timezone indicated by Z) is the universal unambiguous format for data interchange. Use it for database storage, API responses, log files, and any data that crosses system or locale boundaries. Use locale-specific formats only in the final display layer, after parsing from ISO 8601.

FormatExampleUse case
ISO 8601 date2024-05-06Storage, APIs, logs, always unambiguous
ISO 8601 datetime2024-05-06T14:30:00ZTimestamps with timezone (UTC)
Unix timestamp1714953600Compact storage, arithmetic, most databases
RFC 2822Mon, 06 May 2024 14:30:00 +0000Email headers
US format05/06/2024Display only, ambiguous outside US

Timezone handling, UTC and IANA zones

The single most common date bug is storing local times without timezone information. When a user in New York and a user in London both save "meeting at 2pm", the timestamps are 5 hours apart, but if both are stored as bare 14:00 without timezone offset, the data is irrecoverably ambiguous. Always store UTC or store an explicit offset. Convert to the user's local timezone in the display layer only. Use the IANA timezone database format (America/New_York, not EST) because IANA zones account for daylight saving time transitions; abbreviated timezone names like EST are ambiguous and differ between countries.

Related: Number formatter, JSON formatter for API timestamp values.

Frequently Asked Questions

The tool accepts any format that the browser's Date constructor understands, which includes: ISO 8601 (2024-03-15, 2024-03-15T14:30:00Z), human-readable formats (March 15 2024, 15 Mar 2024), US format (03/15/2024), Unix timestamps in seconds (10 digits) or milliseconds (13 digits), and RFC 2822 email date strings. Ambiguous formats like 01/02/2024 (January 2 or February 1?) are interpreted using the browser's locale.

A Unix timestamp is the number of seconds (or milliseconds in JavaScript) that have elapsed since January 1, 1970 at 00:00:00 UTC, known as the "Unix epoch." Timestamps are timezone-independent and are the standard way to store dates in databases, APIs, and system logs. The 10-digit form (e.g., 1710500000) represents seconds; the 13-digit form (e.g., 1710500000000) represents milliseconds.

ISO 8601 is the international standard for representing dates and times: YYYY-MM-DD for dates, YYYY-MM-DDTHH:MM:SSZ for timestamps. It is unambiguous (03/05 means March 5 in the US but May 3 in Europe, ISO 8601 always means March 5), sorts correctly as text, and is recognized by virtually every programming language and database. Use ISO 8601 whenever you store or exchange dates in systems or APIs.