This module defines a time representation based on a Date and the time of day.
zero represents the first millisecond of the first day of the
current era. Use it to construct DateTime values:
-- 0-01-01T00:00:00Z
dateTime zero
-- 2016-01-01T00:00:00Z
dateTime { zero | year = 2016 }
-- 2016-05-29T13:00:00Z
dateTime { zero | year = 2016, month = 5, day = 29, hour = 13 }epoch is the instant in time that represents the first millisecond of the UNIX Epoch.
dateTime constructs a DateTime value given a date and a time. Invalid values are clamped to the nearest valid date and time.
date returns a DateTime's Date.
year returns a DateTime's year.
month returns a DateTime's month.
day returns a DateTime's day.
weekday returns a DateTime's day of the week.
hour returns a DateTime's hour.
minute returns a DateTime's minute.
second returns a DateTime's second.
millisecond returns a DateTime's millisecond.
setDate sets a DateTime's Date.
setYear sets a DateTime's year.
See also Time.Date.setYear.
setMonth sets a DateTime's month.
See also Time.Date.setMonth.
setDay sets a DateTime's day.
See also Time.Date.setDay.
setHour sets a DateTime's hour.
setMinute sets a DateTime's minute, returning Nothing if the updated time is invalid or Just the new DateTime.
setSecond sets a DateTime's second, returning Nothing if the updated time is invalid or Just the new DateTime.
setMillisecond sets a DateTime's millisecond, returning Nothing if the updated time is invalid or Just the new DateTime.
addYears adds a relative number of years to a DateTime value.
See also Time.Date.addYears.
addMonths adds a relative number of months to a DateTime value.
See also Time.Date.addMonths.
addDays adds an absolute number of days to a DateTime value.
See also Time.Date.addDays.
addHours adds a relative number of hours to a DateTime value.
addMinutes adds a relative number of minutes to a DateTime value.
addSeconds adds a relative number of seconds to a DateTime value.
addMilliseconds adds an absolute number of milliseconds to a DateTime value.
compare two DateTimes.
DateTimeDelta represents the relative difference between two DateTime values.
delta computes the relative difference between two DateTime values.
isValidTime returns True if the given hour, minute, second and millisecond represent a valid time of day.
toTimestamp converts a DateTime value to its UNIX timestamp representation as milliseconds.
fromTimestamp converts the millisecond representation of a UNIX timestamp into a DateTime value.
toTuple converts a DateTime into a (year, month, day, hour, miunte, second, millisecond) tuple.
fromTuple converts a (year, month, day, hour, minute, second, millisecond) tuple into a DateTime.
toISO8601 renders a DateTime in ISO8601 format.
fromISO8601 parses an ISO8601-formatted date time string into a DateTime object, adjusting for its offset.
DateTime is the opaque type for all DateTime values. Values of this type represent a valid Date and a time offset from midnight.