AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I format a date in different formats?

Enter a date into AnyTool Date Formatter — pick it, paste any common form (ISO 8601, US MM/DD/YYYY, European DD/MM/YYYY, RFC 2822) or a Unix timestamp, or type “now” — and it renders that instant in thirteen formats at once, each with a one-click copy button: ISO 8601, RFC 2822, US, European, a long localized form, Unix seconds and milliseconds, relative time like “2 hours ago”, the weekday, the day of the year and the ISO week number. A custom pattern field uses the familiar moment/dayjs tokens (YYYY-MM-DD HH:mm:ss, plus Do, dddd, MMMM, SSS, Z) and updates live, and you can choose any locale and IANA time zone. Everything runs in your browser.

  • Shows one date in 13 standard formats simultaneously, each copyable
  • Parses ISO 8601, US, European, RFC 2822 and Unix timestamps flexibly
  • Custom moment/dayjs token pattern (YYYY-MM-DD HH:mm:ss) with live preview
  • Locale, IANA time zone and 12/24-hour controls via the Intl API
  • 100% in your browser — no upload, no signup, works offline

What is

Date Formatting

Date formatting turns a date-time value into a text string following a chosen convention — a standard such as ISO 8601 (2026-06-09T17:05:08Z) or RFC 2822, a regional layout such as US MM/DD/YYYY or European DD/MM/YYYY, a Unix timestamp, or a custom token pattern (e.g. YYYY-MM-DD HH:mm:ss) where each token stands for a date component. In the browser, localized and time-zone-aware formatting is done with Intl.DateTimeFormat, and human phrases like “2 hours ago” with Intl.RelativeTimeFormat. It is the inverse of date parsing, which reads a string back into a date.

Converters

Related terms

ISO 8601Unix timestampIntl.DateTimeFormatFormat tokensTime zone

Frequently Asked Questions

YYYY-MM-DD is the ISO 8601 date pattern — four-digit year, two-digit month, two-digit day, so 9 June 2026 is 2026-06-09.

In token-based formatting, YYYY is the four-digit year, MM the two-digit month and DD the two-digit day, so YYYY-MM-DD writes 9 June 2026 as 2026-06-09 — the international ISO 8601 order that sorts correctly as text. AnyTool Date Formatter lets you type that pattern, or any other moment/dayjs tokens such as HH:mm:ss, dddd or MMMM, and shows the result live as you type.

Paste the Unix timestamp into the date field — 10 digits are read as seconds, 13 as milliseconds — and it is shown in every readable format at once.

A Unix timestamp counts seconds (or milliseconds) since 1 January 1970 UTC. Paste it into AnyTool Date Formatter and it detects whether the number is seconds or milliseconds, converts it to a Date, and renders it as ISO 8601, RFC 2822, US and European dates, a localized long form and a relative phrase — all computed locally in your browser.

US puts the month first (MM/DD/YYYY) and Europe puts the day first (DD/MM/YYYY), so 06/09/2026 is 9 June in the US and could be read as June 9 versus 6 September.

The US convention writes the month before the day (MM/DD/YYYY), while most of Europe and much of the world writes the day before the month (DD/MM/YYYY) — which is why a date like 06/09/2026 is ambiguous. AnyTool shows both layouts side by side, and ISO 8601 (YYYY-MM-DD) avoids the ambiguity entirely by going from largest unit to smallest.

Yes — pick any IANA time zone such as Asia/Tokyo or America/New_York and the tool converts the same instant into that zone.

AnyTool Date Formatter has a time-zone picker covering major IANA zones. Choosing one uses the browser-native Intl.DateTimeFormat to render the same instant in that region, including its short zone name, while ISO 8601 and RFC 2822 stay in UTC and the other formats use your local time zone. No data leaves your device.

Detailed Explanation

Methodology

How the Date Formatter Works

AnyTool Date Formatter takes a single instant and renders it many ways from one Date object. It first parses the input flexibly: the word “now” snaps to the current moment; a pure integer is treated as a Unix timestamp (seconds for ≤11 digits, milliseconds for 12 or more); slash- or dash-separated numbers are resolved as US (month-first) or European (day-first) by inspecting which part exceeds 12; and anything else falls back to the native Date constructor, which accepts ISO 8601 and RFC 2822. From that Date it produces ISO 8601 (UTC via toISOString and local-offset via tokens), RFC 2822 (toUTCString), US and European slashes, Unix seconds and milliseconds, a localized long form, a relative phrase, the weekday, the ISO week number and the ordinal day of the year. All of this is pure client-side JavaScript.

  • Flexible parser: ISO 8601, US, European, RFC 2822, Unix and “now”
  • Integer inputs auto-detected as Unix seconds or milliseconds
  • US vs European resolved by which date part is greater than 12
  • Thirteen formats generated from one Date, each independently copyable
  • Runs entirely in the browser — no server round-trip
How It Works

Custom Token Patterns and the Intl API

The custom pattern field implements a moment/dayjs-style token system: YYYY and YY for the year, MMMM/MMM/MM/M for the month, DD/D/Do for the day, dddd/ddd/dd/d for the weekday, HH/H/hh/h for hours, mm/ss/SSS for minutes, seconds and milliseconds, A/a for the meridiem, X/x for Unix timestamps, and Z/ZZ for the UTC offset. Tokens are matched longest-first so YYYY wins over YY, and literal text can be wrapped in [square brackets] to pass through untouched, exactly as in Day.js. Localized output uses the browser-native Intl.DateTimeFormat with the chosen locale, dateStyle and timeStyle and 12- or 24-hour clock, a separate panel re-renders the instant in any IANA time zone with Intl, and relative phrases such as “in 3 days” come from Intl.RelativeTimeFormat with numeric set to auto.

  • Token table modelled on moment.js and Day.js (YYYY, MMMM, Do, dddd, SSS, Z)
  • Longest-token-first matching; [brackets] escape literal text
  • Localized long form via Intl.DateTimeFormat (dateStyle/timeStyle, hour12)
  • Any IANA time zone rendered with the timeZone option
  • Relative time via Intl.RelativeTimeFormat (numeric: auto)
Privacy & Security

Privacy and Offline Use

Because every format is computed locally with the standard Date and Intl APIs, no date is ever uploaded, there is no tracking, and the page works offline after first load. The tool is honest about time-zone scope: custom-pattern, US/European and Unix outputs read the date in the computer’s local time zone, ISO 8601 and RFC 2822 are shown in UTC, and the dedicated time-zone row converts to whichever IANA zone you select.

Date formatting: in-browser (AnyTool) vs typical online date tools
CapabilityAnyToolTypical online date tools
ProcessingRuns in your browserOften server-side
Formats shown13 standards at once, each copyableUsually one at a time
Input parsingISO, US, EU, RFC 2822, Unix, “now”Frequently one fixed format
Custom tokensFull moment/dayjs pattern with presetsLimited or none
Locale & time zoneIntl.DateTimeFormat + any IANA zoneRarely configurable
Relative timeIntl.RelativeTimeFormat (localized)Seldom offered
Works offlineYes (PWA)No
Cost / signupFree, no signupOften ad-heavy or gated

AnyTool formats dates locally with the standard Date and Intl APIs and uploads nothing.