fromDateTime renders a DateTime in ISO8601 format.
import Time.DateTime exposing (..)
epoch
|> addMilliseconds 61000
|> fromDateTime
--> "1970-01-01T00:01:01.000Z"fromZonedDateTime renders a ZonedDateTime in ISO8601 format.
import Time.ZonedDateTime
import Time.TimeZones exposing (america_new_york)
import Time.DateTime exposing (epoch)
Time.ZonedDateTime.fromDateTime (america_new_york ()) epoch
|> fromZonedDateTime
--> "1969-12-31T19:00:00.000-05:00"toDate parses an ISO8601-formatted date string into a Date. import Time.Date
toDate "1970-12-01"
--> Ok (Time.Date.date 1970 12 1)
toDate "19701201"
--> Ok (Time.Date.date 1970 12 1)toDateTime parses an ISO8601-formatted date time string into a DateTime object, adjusting for its timezone offset.
toZonedDateTime parses an ISO8601-formatted string into a ZonedDateTime object, adjusting for its offset.
import Time.ZonedDateTime
import Time.TimeZones exposing (america_new_york)
import Time.DateTime exposing (epoch)
toZonedDateTime (america_new_york ()) "1970-01-01T00:00:00.000Z"
--> Ok (Time.ZonedDateTime.fromDateTime (america_new_york ()) epoch)
fromDate renders a Date in ISO8601 format.