waratuman / time-extra / Time.Extra

Library for manipulating the Posix type from elm/time.

addDays : Basics.Int -> Time.Posix -> Time.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 : Basics.Int -> Time.Zone -> Time.Posix -> Time.Posix

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

addHours : Basics.Int -> Time.Posix -> Time.Posix

Add the given hours to the Posix time.

addMillis : Basics.Int -> Time.Posix -> Time.Posix

Add the given milliseconds to the Posix time.

addMinutes : Basics.Int -> Time.Posix -> Time.Posix

Add the given minutes to the Posix time.

addSeconds : Basics.Int -> Time.Posix -> Time.Posix

Add the given seconds to the Posix time.

anteMeridiem : Time.Zone -> Time.Posix -> Basics.Bool

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

compare : Time.Posix -> Time.Posix -> Basics.Order

Compares one Posix time to another.

daysInMonth : Basics.Int -> Time.Month -> Basics.Int

The number of days in a given year and month.

endOfDay : Time.Zone -> Time.Posix -> Time.Posix

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

endOfMonth : Time.Zone -> Time.Posix -> Time.Posix

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

endOfWeek : Time.Zone -> Time.Weekday -> Time.Posix -> Time.Posix

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

epoch : Time.Posix

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

fromDateTuple : Time.Zone -> ( Basics.Int, Time.Month, Basics.Int ) -> Time.Posix

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

fromIso8601Date : Time.Zone -> String -> Maybe Time.Posix

Converts an ISO8601 date into aPosix for a given Zone.

intToMonth : Basics.Int -> Maybe Time.Month

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

monthToInt : Time.Month -> Basics.Int

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

setDay : Time.Zone -> Basics.Int -> Time.Posix -> Time.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 : Time.Zone -> Basics.Int -> Time.Posix -> Time.Posix

Set the hour of a Posix given a Zone.

setMillis : Time.Zone -> Basics.Int -> Time.Posix -> Time.Posix

Set the milliseconds of a Posix given a Zone.

setMinute : Time.Zone -> Basics.Int -> Time.Posix -> Time.Posix

Set the minutes of a Posix given a Zone.

setMonth : Time.Zone -> Time.Month -> Time.Posix -> Time.Posix

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

setSecond : Time.Zone -> Basics.Int -> Time.Posix -> Time.Posix

Set the seconds of a Posix given a Zone.

setYear : Time.Zone -> Basics.Int -> Time.Posix -> Time.Posix

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

startOfDay : Time.Zone -> Time.Posix -> Time.Posix

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

startOfHour : Time.Zone -> Time.Posix -> Time.Posix

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

startOfMonth : Time.Zone -> Time.Posix -> Time.Posix

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

startOfWeek : Time.Zone -> Time.Weekday -> Time.Posix -> Time.Posix

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

toDateTuple : Time.Zone -> Time.Posix -> ( Basics.Int, Time.Month, Basics.Int )

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

toIso8601Date : Time.Zone -> Time.Posix -> String

Converts a Posix into an ISO8601 date for a given Zone

toIso8601DateTime : Time.Zone -> Time.Posix -> String

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

toIso8601DateTimeUTC : Time.Posix -> String

Converts a Posix into an ISO8601 date and time in UTC

toIso8601Time : Time.Zone -> Time.Posix -> String

Converts a Posix into an ISO8601 time for a given Zone

toTimeTuple : Time.Zone -> Time.Posix -> ( Basics.Int, Basics.Int, Basics.Int )

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

weekdayFromInt : Basics.Int -> Result String Time.Weekday

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

weekdayToInt : Time.Weekday -> Basics.Int

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

endOfHour : Time.Zone -> Time.Posix -> Time.Posix

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