waratuman/time-extra/1.0.0

NOTE: the latest version is 1.1.0

Time.Extra

Library for manipulating the Posix type from elm/time.

addDays : Int -> Posix -> Posix

Adds 24 hours to a Posix. Note that this function does not account for daylight savings time.

Maybe you want the addDaysZ function?

addDaysZ : Int -> Zone -> Posix -> Posix

Adds 24 hours to a Posix, attempting to correct for daylight savings time.

addHours : Int -> Posix -> Posix

Add the given hours to the Posix time.

addMillis : Int -> Posix -> Posix

Add the given milliseconds to the Posix time.

addMinutes : Int -> Posix -> Posix

Add the given minutes to the Posix time.

addSeconds : Int -> Posix -> Posix

Add the given seconds to the Posix time.

anteMeridiem : Zone -> Posix -> Bool

Does the given Posix occure in the morning of a given Zone?

compare : Posix -> Posix -> Order

Compares one Posix time to another.

daysInMonth : Int -> Month -> Int

The number of days in a given year and month.

endOfDay : Zone -> Posix -> Posix

Set the Posix to the end of the day in a given Zone.

endOfMonth : Zone -> Posix -> Posix

Set the Posix to the end of the month in a given Zone.

endOfWeek : Zone -> Weekday -> Posix -> Posix

Set the Posix to the end of the week in a given Zone and the start of the week (a Weekday).

epoch : Posix

Unix epoch (1970-01-01T00:00:00Z).

fromDateTuple : Zone -> ( Int, Month, Int ) -> Posix

Converts a date tuple (year, month, day) to a Posix for a given Zone.

intToMonth : Int -> Maybe Month

Convert an Int to a Month, with January being 1.

monthToInt : Month -> Int

Convert a Month to an Int, with January being 1.

setDay : Zone -> Int -> Posix -> Posix

Set the day of month for a given Zone. If the given day is greater then the number of days in the month it is set to the last day of the month.

setHour : Zone -> Int -> Posix -> Posix

Set the hour of a Posix given a Zone.

setMillis : Zone -> Int -> Posix -> Posix

Set the milliseconds of a Posix given a Zone.

setMinute : Zone -> Int -> Posix -> Posix

Set the minutes of a Posix given a Zone.

setMonth : Zone -> Month -> Posix -> Posix

Set the month of a Posix time for a given Zone.

setSecond : Zone -> Int -> Posix -> Posix

Set the seconds of a Posix given a Zone.

setYear : Zone -> Int -> Posix -> Posix

Set the year of a Posix time for a given Zone.

startOfDay : Zone -> Posix -> Posix

Set the Posix to the start of the day in a given Zone.

startOfHour : Zone -> Posix -> Posix

Set the Posix to the start of the hour in a given Zone.

startOfMonth : Zone -> Posix -> Posix

Set the Posix to the start of the month in a given Zone.

startOfWeek : Zone -> Weekday -> Posix -> Posix

Set the Posix to the start of the week in a given Zone and the start of the week (a Weekday).

toDateTuple : Zone -> Posix -> ( Int, Month, Int )

Converts a Posix into a date tuple (year, month, day) for a given Zone

toIso8601Date : Zone -> Posix -> String

Converts a Posix into an ISO8601 date for a given Zone

toIso8601DateTime : Zone -> Posix -> String

Converts a Posix into an ISO8601 date and time for a given Zone

toIso8601DateTimeUTC : Posix -> String

Converts a Posix into an ISO8601 date and time in UTC

toIso8601Time : Zone -> Posix -> String

Converts a Posix into an ISO8601 time for a given Zone

toTimeTuple : Zone -> Posix -> ( Int, Int, Int )

Converts a Posix into a time tuple (hour, minute, second) for a given Zone

weekdayFromInt : Int -> Result String Weekday

Convert an Int to a Weekday, with Monday being 1 and Sunday being 7.

weekdayToInt : Weekday -> Int

Convert a Weekday to an Int, with Monday being 1 and Sunday being 7.

endOfHour : Zone -> Posix -> Posix

Set the Posix to the end of the hour in a given Zone.