User Rating 0.0
Total Usage 0 times
Category Time & Date
Use tokens from the reference table. Escape literals with [brackets].
Is this tool helpful?

Your feedback helps us improve.

About

Date formatting errors cause silent data corruption across systems. A date written as 01/02/2024 means January 2nd in the US but February 1st in Europe. Database imports fail. API payloads get rejected. Spreadsheet sorting breaks. This tool converts any input date into 20+ standardized output formats - ISO 8601, RFC 2822, Unix epoch seconds, ordinal dates, and fully custom token patterns - eliminating ambiguity. It computes the ISO week number using the algorithm defined in ISO 8601:2004 and calculates the Julian Day Number (JDN) for astronomical cross-referencing.

The custom format engine parses token strings such as YYYY-MM-DD and replaces each token with the corresponding date component. Locale-aware month and weekday names are derived from the browser's Intl.DateTimeFormat API. This tool approximates locale conventions assuming the browser's ICU dataset is complete. Edge cases include leap second ambiguity and the Gregorian calendar's lack of a year zero - the tool handles proleptic Gregorian dates but accuracy degrades for dates before 1582.

date formatter date format converter ISO 8601 date to string calendar date date format tool unix timestamp RFC 2822

Formulas

The ISO week number W is computed per ISO 8601:2004. The algorithm finds the Thursday of the current week and determines its ordinal position within the year:

W = ordinal(Thursday) 17 + 1

where ordinal(Thursday) is the day-of-year of the Thursday in the same ISO week as the input date. The Julian Day Number JDN for a Gregorian calendar date is:

JDN = 367Y 7(Y + M + 912)4 + 275M9 + D + 1721013.5

where Y = year, M = month (1 - 12), D = day. The Unix timestamp X is:

X = t epoch1000

where t is the date's millisecond value and epoch = January 1, 1970 00:00:00 UTC. Ordinal suffixes follow English rules: 1→st, 2→nd, 3→rd, all others→th, except 11, 12, 13 which take th.

Reference Data

TokenDescriptionExample Output
YYYY4-digit year2024
YY2-digit year24
MMMMFull month nameDecember
MMMAbbreviated monthDec
MMMonth zero-padded01 - 12
MMonth unpadded1 - 12
DDDay zero-padded01 - 31
DDay unpadded1 - 31
DoDay with ordinal suffix1st, 2nd, 23rd
ddddFull weekday nameWednesday
dddAbbreviated weekdayWed
dd2-letter weekdayWe
dDay of week (0=Sun)0 - 6
HHHour 24h zero-padded00 - 23
HHour 24h unpadded0 - 23
hhHour 12h zero-padded01 - 12
hHour 12h unpadded1 - 12
mmMinutes zero-padded00 - 59
ssSeconds zero-padded00 - 59
AAM/PM uppercaseAM, PM
aam/pm lowercaseam, pm
XUnix timestamp (seconds)1700000000
xUnix timestamp (milliseconds)1700000000000
WISO week number1 - 53
WWISO week zero-padded01 - 53
DDDDay of year1 - 366
QQuarter of year1 - 4
ZZUTC offset+05:30
ZUTC offset short+0530

Frequently Asked Questions

ISO 8601 uses big-endian ordering (most significant unit first) so that lexicographic string sorting produces chronological ordering. This eliminates the DD/MM vs MM/DD ambiguity that causes data corruption in cross-locale systems. Databases, filenames, and APIs universally benefit from this property.
ISO 8601 defines week 1 as the week containing the first Thursday of the year. This means January 1st can fall in ISO week 52 or 53 of the previous year. The algorithm anchors on Thursday because the middle of a Mon-Sun week always falls in the correct year. For example, January 1, 2016 (Friday) belongs to ISO week 53 of 2015.
The Julian Day Number (JDN) is a continuous day count starting from January 1, 4713 BC (proleptic Julian calendar). Astronomers use it to compute time intervals between events across calendar system changes. It avoids month/year arithmetic entirely. For example, 2024-01-01 has JDN approximately 2460310.5.
The tool uses the proleptic Gregorian calendar for all dates, meaning it extends Gregorian rules backwards. This is mathematically consistent but historically inaccurate for dates before October 15, 1582 (or later in some countries). Julian calendar dates in historical documents will not match the output exactly.
A year is a leap year if divisible by 4, except centuries (divisible by 100) which must also be divisible by 400. So 2000 was a leap year, 1900 was not. This affects the Day of Year (DDD) token: leap years have 366 days. The tool validates February 29 against this rule and rejects invalid dates.
The tokenizer processes tokens greedily from left to right, matching the longest token first. For example, "DDDo" matches DDD (day of year) then "o" as literal text, not DD + Do. Escape literal characters by wrapping them in square brackets: [D] outputs the letter D instead of the day number.