Date.Convert - convert dates to other types (mainly formatted strings)Date.Create - create dates from other typesDate.Extract - additional extractions to those in the core libraryDate.Facts - lookups and constantsDate.Math - operations for dates (e.g. floor, add, clamp, range)
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import Date exposing (Date)import Date.Extra as Dateimport Date.Extra.Facts exposing (monthFromMonthNumber)dateFromRecord : JsonDateTime -> DatedateFromRecord { year, month, day, hour, minute, second, millisecond, timezone } =Date.fromSpec(Date.offset <| timezone.offset_utc + timezone.offset_std)(Date.atTime hour minute second millisecond)(Date.calendarDate year (monthFromMonthNumber month) day)
dateRecord : JsonDateTimedateRecord =
{ year = 2016, timezone ={ until = "max"
, offset_utc = -360, offset_std = 60, full_name = "America/Chicago", from = "min", abbreviation = "CDT"
}, second = 8, month = 7, minute = 14, millisecond = 86, hour = 4, day = 18, calendar = "gregorian"}
Date.toUtcIsoString (dateFromRecord dateRecord)-- "2016-07-18T09:14:08.086Z"