User Rating 0.0
Total Usage 2 times
Universal Time (UTC)
Loading...
Local System Time
Loading...
Unix Epoch (Seconds)
Loading...
Generated ISO String
P1Y2M...
Week Date
Ordinal Date
Filename Safe
Unix Timestamp (ms)

Construct a period vector to add to a date. E.g., "1 Year and 2 Days".

Date Part
Years (Y)
Months (M)
Weeks (W)
Days (D)
T
Time Part
Hours (H)
Minutes (M)
Seconds (S)
ISO 8601 Duration String
P0D
Calculator: Add this duration to a date
+ Duration = --
Waiting for input...
How to generate current ISO time
How to parse ISO string
Copied to clipboard
Is this tool helpful?

Your feedback helps us improve.

About

Time is not a flat circle; in software engineering, it is a complex linear vector fraught with ambiguity. The ISO 8601 standard is the internationally accepted solution for the representation of dates and times. It eliminates the confusion of local formats (e.g., 01/02/03 - is that Jan 2nd, 2003, or Feb 1st, 2003?) by enforcing a strict big-endian lexicographical order: Year, Month, Day, Hour, Minute, Second.

For systems architects and developers, adherence to ISO 8601 (and its internet profile, RFC 3339) is non-negotiable for API design, database storage, and log serialization. This suite goes beyond simple conversion. It provides a rigorous environment to generate compliant strings, calculate P (Period) durations, validate intervals, and generate the specific parsing code required for your tech stack, from Python to Rust. It handles the mathematical nuances of offsets, ordinal dates, and the precise syntax of delimiters.

iso 8601 rfc 3339 timestamp generator duration calculator date parser week date ordinal date

Formulas

The construction of an ISO 8601 string follows a strict concatenation logic. For a global timestamp with offset, the mathematical structure is:

ISO = Datepart + T + Timepart + Offset

Where the Offset is defined by the difference between Local Time and UTC:

Offset =
{
Z if Local == UTC±hh:mm otherwise

Calculating the Ordinal Day (doy) from a standard date involves summing the days of preceding months. Let M be the month index (1-12) and D be the day of the month:

doy = D + M-1i=1 daysInMonthi

For Durations, the operation is vector addition, not scalar addition. Adding P1M (1 month) to 2024-01-31 yields 2024-02-29 (leap year), while adding it to 2023-01-31 yields 2023-02-28. The magnitude of P1M changes based on the starting operand.

Reference Data

Format NamePattern StructureExample ValueContext & Usage
Extended DateYYYY-MM-DD2025-10-31Standard storage format. Requires hyphens.
Basic DateYYYYMMDD20251031Legacy systems, filenames, compact storage.
UTC TimestampDateTTimeZ2025-10-31T14:30:00ZAbsolute time. Z indicates Zero offset (Zulu).
Offset TimestampDateTTime±hh:mm2025-10-31T09:30:00-05:00Local time with explicit deviation from UTC.
Week DateYYYY-Www-D2025-W44-5Commercial/Fiscal calendars. Week starts Monday (1).
Ordinal DateYYYY-DDD2025-304Mainframes, compact systems. Day of Year (1-366).
Duration (Full)PYYMMDDThHmMsSP1Y2M10DT2HVector of time. P=Period, T=Time separator.
Duration (Week)PwWP4WDuration expressed purely in weeks.
Interval (Start/End)Start/End2024-01-01/2025-01-01Span between two instants.
Interval (Start/Dur)Start/Duration2024-01-01/P1MRecurring events or defined validity periods.
High Precision....ssssss...14:30:00.123456Microseconds/Nanoseconds (Implementation specific).
Reduced PrecisionYYYY-MM2025-10Specific month, day unknown or irrelevant.

Frequently Asked Questions

RFC 3339 is a specific "profile" of ISO 8601 intended for internet protocols. The key differences are: 1) RFC 3339 allows the T separator to be replaced by a space (e.g., 2023-10-10 12:00:00Z), whereas strict ISO 8601 requires the T. 2) RFC 3339 requires 4-digit years. 3) RFC 3339 does not support Ordinal Dates (YYYY-DDD) or Week Dates (YYYY-Www).
ISO 8601 allows the seconds component to equal 60 (e.g., 23:59:60) to denote a positive leap second. However, most POSIX-based computer systems (like Unix, Linux, Windows) do not handle leap seconds natively and use NTP smearing or repeat the previous second. While valid in the standard, seeing 60 is rare in web applications.
P stands for "Period". It must start every duration string. The T within a duration string separates the Date components (Years, Months, Days) from the Time components (Hours, Minutes, Seconds). Example: P1DT1H is 1 Day and 1 Hour, whereas P1M is 1 Month and PT1M is 1 Minute.
The ISO Week Date system relies on the rule that "Week 1" of a year is the week containing the first Thursday of that year. This means Jan 1st can actually belong to the last week of the *previous* ISO year (e.g., 2021-01-01 was 2020-W53-5). Conversely, late December days can belong to Week 1 of the *next* year.
Yes. The standard generally expects uppercase letters (T, Z, P, W). While some loose parsers accept lowercase, strictly compliant systems (like many banking APIs) will reject 2023-10-10t12:00:00z.