Unix timestamp vs ISO 8601: which date format to store?

4 min readUpdated May 24, 2026

Both represent an instant in time, but one is a raw number and the other a structured string. The right choice depends on who — or what — reads it.

Unix timestampSeconds since 1970 (a number)
vs
ISO 8601Human-readable date string
Unix timestampISO 8601
Example17000000002023-11-14T22:13:20Z
Human-readableNoYes
TimezoneAlways UTC (implicit)Explicit (Z or offset)
Lexically sortableYes (numeric)Yes (string sort)
ArithmeticTrivial (subtract numbers)Needs parsing
Best forInternal storage, mathAPIs, logs, anything humans read

Readability vs convenience

A Unix timestamp is great for the machine — compact, trivially sortable, and time differences are plain subtraction. But 1700000000 tells a human nothing, and a units mistake (seconds vs milliseconds) silently breaks it.

ISO 8601 (2023-11-14T22:13:20Z) is self-describing and includes its timezone, so logs and API responses are debuggable at a glance. The trade-off is you must parse it to do date math.

A common pattern

Many systems store or transmit ISO 8601 for clarity and convert to a timestamp only when doing arithmetic. APIs increasingly prefer ISO strings for exactly this reason. Convert between both in the Timestamp Converter.

The verdict

Prefer ISO 8601 for APIs, logs, and anything a human might read — it is unambiguous and carries its timezone. Use a Unix timestamp for compact internal storage and easy time math. Convert freely in the Timestamp tool.

Frequently asked questions

Should APIs return Unix timestamps or ISO 8601?
ISO 8601 is generally preferred for APIs: it is human-readable, self-describing, and includes the timezone, which makes debugging far easier.
Are both formats sortable?
Yes. Unix timestamps sort numerically; ISO 8601 strings sort correctly with a plain string sort because the fields go from largest to smallest unit.
Does ISO 8601 include a timezone?
It can and should — a trailing Z means UTC, or an offset like +07:00. Unix timestamps are always implicitly UTC.

Try it yourself

Free, in-browser tools for everything above.