localdatetime Open local time

ISO 8601 Formatter

Turn any date and time into every ISO 8601 form — extended, basic, week date and ordinal.

ISO 8601 is the international standard for writing dates and times, and it has more forms than most people realise. Pick a date and time and this formatter produces the extended form, the basic form without separators, the week date, the ordinal date, RFC 2822 and the Unix timestamp — all copyable.

Why big-endian ordering wins

Writing the year first, then month, then day, means a plain string sort is also a chronological sort. That single property is why filenames, log lines and database columns should use it. The full explanation is in ISO 8601 explained.

Week dates and ordinal dates

The same standard defines 2026-W31-3 (year, ISO week, weekday) and 2026-212 (year and day of year). Week dates matter in payroll and manufacturing; ordinal dates appear in astronomy and aviation. Their rules are covered in ISO week numbers.

Guides about ISO 8601 Formatter

More localdatetime.now pages

Frequently asked questions

What is the correct ISO 8601 format?
The extended form YYYY-MM-DDTHH:MM:SS followed by either Z for UTC or a ±hh:mm offset. The T separates date from time.
Is RFC 3339 the same as ISO 8601?
RFC 3339 is a stricter profile of ISO 8601 used on the internet. Anything valid in RFC 3339 is valid ISO 8601, but not the reverse.
Should I store the Z form or the offset form?
Store the UTC Z form for a recorded instant. Keep the zone identifier separately if you also need to know where it happened.