f0i/iso8601/1.0.0

NOTE: the latest version is 1.1.2

Iso8601

Format a posix time to a ISO8601 String.

Functions

toString : Mode -> Zone -> Posix -> String

Convert a posix time into a ISO8601 string

toUtcString : Mode -> Posix -> String

Format a String without timezone offset

Mode for different precission

type Mode
= Year
| Month
| Day
| Hour
| Minute
| Second
| Milli
| HourOnly
| HourMinute
| HourSecond
| HourMilli

The precission of the resulting String can be defined by the Mode parameter

The resulting string will have the following format

  • Year: "YYYY"
  • Month: "YYYY-MM"
  • Day: "YYYY-MM-DD"
  • Hour: "YYYY-MM-DDThh"
  • Minute: "YYYY-MM-DDThh-mm"
  • Second: "YYYY-MM-DDThh-mm-ss"
  • Milli: "YYYY-MM-DDThh-mm-ss.sss"
  • HourOnly: "hh"
  • HourMinute: "hh-mm"
  • HourSecond: "hh-mm-ss"
  • HourMilli: "hh-mm-ss.sss"