An ISO 8601 date formating and parsing library for Erlang
Erlang Makefile
Latest commit 1a315d4 Jan 7, 2017 @oubiwann oubiwann committed on GitHub Updated copyright dates and attribution.


Build Status Tag Erlang Version Downloads

An ISO 8601 date formating and parsing library for Erlang

iso8601 project logo



The erlang_iso8601 library was originally created by Sean Sawyer in 2011. In 2016, Sean handed off maintenance of the library to the erlsci Github org at which point the project (and repo) was renamed to simply iso8601, matching its Erlang app name:

  • git clone

Thanks to Github's forwarding for project renames and moves, the following still work:

  • git clone
  • git clone


Add it to your rebar.config deps:

{iso8601, ".*", {git, "", {tag, "1.2.3"}}}

Or for rebar3:

{iso8601, {git, "", {tag, "1.2.3"}}}

Format a timestamp or calendar datetime tuple:

1> iso8601:format(now()).
2> iso8601:format(calendar:universal_time()).

Parse a date string or binary:

3> iso8601:parse(<<"2012-02-16T01:06:48Z">>).
4> iso8601:parse("2012-02-16T01:06:48Z").

Add 1 hour, 2 minutes and 3 seconds to a datetime tuple:

5> Datetime = iso8601:parse(<<"2012-02-16T01:06:48Z">>).
6> iso8601:add_time(Datetime, 1, 2, 3).

Fractional times:

7> iso8601:parse("20120203T040506.50").
8> iso8601:parse_exact("20120203T040506.50").

Known Deficiencies

  • Does not support expanded year representation.
  • Does not support intervals.

See the open issues for more info.


The MIT License (MIT)

Copyright © 2011-2014, Sean Sawyer
Copyright © 2012, Tristan Sloughter
Copyright © 2016-2017, Erlang-Aided Enrichment Center