Skip to main content
Date and Time on the Internet:

Internet timestamps

Summary

This article explains ABNF (RFC 3339) and IXDTF (RFC 9557) timestamp formats with grammar rules, and syntax comparison. You will learn about format specifiers, timestamp types, and precision handling.

Introduction #

Timestamps are used in internet protocols, file metadata, and data serialization formats to represent date and time in a machine-readable form. Two major formats for these timestamps are defined in RFC 3339 and RFC 9557.

RFC 3339 #

RFC 3339 (Date and Time on the Internet: Timestamps) defines a profile of ISO 8601 for use in internet protocols. It uses Augmented Backus-Naur Form (ABNF) to specify the grammar.

Grammar #

date-fullyear   = 4DIGIT
date-month      = 2DIGIT  ; 01-12
date-mday       = 2DIGIT  ; 01-28, 01-29, 01-30, 01-31
time-hour       = 2DIGIT  ; 00-23
time-minute     = 2DIGIT  ; 00-59
time-second     = 2DIGIT  ; 00-58, 00-59, 00-60
time-secfrac    = "." 1*DIGIT
time-numoffset  = ("+" / "-") time-hour ":" time-minute
time-offset     = "Z" / time-numoffset

partial-time    = time-hour ":" time-minute ":" time-second [time-secfrac]
full-date       = date-fullyear "-" date-month "-" date-mday
full-time       = partial-time time-offset

date-time       = full-date "T" full-time

IXDTF (RFC 9557) #

Internet Extended Date/Time Format (IXDTF) extends RFC 3339 with additional features like approximate times, uncertain times, and extended timezone information.

Grammar #

ixdtf-date-time = full-date "T" ixdtf-full-time
ixdtf-full-time = partial-time ixdtf-offset
ixdtf-offset    = (time-offset / ixdtf-numoffset)
ixdtf-numoffset = ("+" / "-") time-hour [[":" time-minute] [precision]]
precision       = "~" / "%" / "@" / "*"

Syntax comparison #

The following table compares the key syntactic differences between RFC 3339 and IXDTF (RFC 9557) timestamp formats:

ComponentRFC 3339IXDTF
Date separator--
Time separator::
DateTime sep.TT
TimezoneZ or ±hh:mmZ, ±hh:mm, or ±hh with precision
PrecisionNot supported~, %, @, *
Leap secondsNot specifiedSupported (:60)

Timestamp types #

The table below shows various timestamp representations with examples and descriptions, covering both basic formats and extended IXDTF features:

TypeExampleDescription
Full datetime2025-06-06T14:28:00ZRFC 3339 format
Date only2025-06-06Full date without time
Time only14:28:00ZTime with UTC indicator
Interval2025-06-06/2025-06-07Time interval
DurationPT2H2-hour duration
Approximate~2025-06-06Approximate date (IXDTF)
Open range..2025-06-06Open interval to a date
RecurringR10/2025-06-06T14:00:00Z/P2D10 repetitions every 2 days

Timestamp examples #

  1. 1985-04-12T23:20:50Z
  2. 1996-12-19T16:39:57-08:00
  3. 2020-01-01T00:00:00Z~
  4. 2038-01-19T03:14:07+01:00%
  5. 2001-09-09T01:46:40Z@
  6. 1970-01-01T00:00:00Z*
  7. 2106-02-07T06:28:15-05:00~
  8. 1999-12-31T23:59:60Z
  9. 2000-01-01T00:00:00.000Z
  10. 2023-11-15T14:30:00.123456789Z
  11. 1989-11-09T18:00:00+01:00%
  12. 2012-12-21T12:00:00Z~
  13. 2008-08-08T08:08:08+08:00@
  14. 1969-07-20T20:17:40Z*
  15. 2033-05-18T03:33:20-00:00~
  16. 2004-02-29T00:00:00Z%
  17. 2011-03-11T14:46:23+09:00@
  18. 1977-05-25T00:00:00Z*
  19. 2045-01-01T00:00:00.999Z~
  20. 2022-02-22T22:22:22-22:00%

Format specifiers #

The following table explains common format specifiers used in timestamp formatting:

SpecifierMeaningExample
%Y4-digit year2025
%y2-digit year23
%m2-digit month (01-12)11
%BFull month nameNovember
%bAbbreviated month nameNov
%d2-digit day of month (01-31)15
%H2-digit hour (00-23)14
%I2-digit hour (01-12)02
%M2-digit minute (00-59)30
%S2-digit second (00-60)00
%fMicroseconds (6 digits)123456
%zTimezone offset (±HHMM)+0100
%:zTimezone offset (±HH:MM)+01:00
%ZTimezone name/abbreviationUTC, CET
%jDay of year (001-366)319
%UWeek number (00-53, Sunday week)45
%WWeek number (00-53, Monday week)45
%AFull weekday nameWednesday
%aAbbreviated weekday nameWed
%TTime (equivalent to %H:%M:%S)14:30:00
%FDate (equivalent to %Y-%m-%d)2023-11-15
%RShort time (equivalent to %H:%M)14:30
%%Literal percent sign%

These specifiers are commonly supported in programming languages and tools.

The exact support for these specifiers may vary between implementations, but most follow the POSIX strftime conventions.

Some implementations add extensions for nanoseconds, timezone names, or locale-specific formatting.

FAQ's #

Most common questions and brief, easy-to-understand answers on the topic:

What is the difference between RFC 3339 and IXDTF?

RFC 3339 defines a profile of ISO 8601 for internet timestamps, while IXDTF (RFC 9557) extends it with additional features like timezone offsets and precision indicators.

How do you represent timezone offsets in IXDTF?

In IXDTF, timezone offsets use the format ±hh:mm or Z for UTC, with optional precision indicators like ~ for approximate times.

Can IXDTF timestamps include leap seconds?

Yes, IXDTF supports leap seconds with the :60 notation in the seconds field when needed.

What is the maximum precision supported by these formats?

Both RFC 3339 and IXDTF support up to nanosecond precision, though implementations may limit this based on their requirements.

Further readings #

Sources and recommended, further resources on the topic:

Author

Jonas Jared Jacek • J15k

Jonas Jared Jacek (J15k)

Jonas works as project manager, web designer, and web developer since 2001. On top of that, he is a Linux system administrator with a broad interest in things related to programming, architecture, and design. See: https://www.j15k.com/

License

Internet timestamps by Jonas Jared Jacek is licensed under CC BY-SA 4.0.

This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:

<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/internet-timestamps">Internet timestamps</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>

For more information see the Ditig legal page.

All Topics

Random Quote

“Did we imagine that people would do bad things on the web? Absolutely.”

Tim Berners-Lee English computer scientist, inventor of the World Wide WebTIME, - IT quotes