Module

Data.Time

Package
purescript-datetime
Repository
purescript/purescript-datetime

#hour Source

hour :: Time -> Hour

The hour component of a time value.

#setHour Source

setHour :: Hour -> Time -> Time

Alters the hour component of a time value.

#minute Source

minute :: Time -> Minute

The minute component of a time value.

#setMinute Source

setMinute :: Minute -> Time -> Time

Alters the minute component of a time value.

#second Source

second :: Time -> Second

The second component of a time value.

#setSecond Source

setSecond :: Second -> Time -> Time

Alters the second component of a time value.

#millisecond Source

millisecond :: Time -> Millisecond

The millisecond component of a time value.

#setMillisecond Source

setMillisecond :: Millisecond -> Time -> Time

Alters the millisecond component of a time value.

#adjust Source

adjust :: forall d. Duration d => d -> Time -> Tuple Days Time

Adjusts a time value with a duration offset. The result includes a remainder value of the whole number of days involved in the adjustment, for example, if a time of 23:00:00:00 has a duration of +2 hours added to it, the result will be 1 day, and 01:00:00:00. Correspondingly, if the duration is negative, a negative number of days may also be returned as the remainder.

#diff Source

diff :: forall d. Duration d => Time -> Time -> d

Calculates the difference between two times, returning the result as a duration.

Re-exports from Data.Time.Component

#Second Source

newtype Second

An second component for a time value.

The constructor is private as values for the type are restricted to the range 0 to 59, inclusive. The toEnum function can be used to safely acquire an Second value from an integer. Correspondingly, a Second can be lowered to a plain integer with the fromEnum function.

Instances

#Minute Source

newtype Minute

An minute component for a time value.

The constructor is private as values for the type are restricted to the range 0 to 59, inclusive. The toEnum function can be used to safely acquire an Minute value from an integer. Correspondingly, a Minute can be lowered to a plain integer with the fromEnum function.

Instances

#Millisecond Source

newtype Millisecond

An millisecond component for a time value.

The constructor is private as values for the type are restricted to the range 0 to 999, inclusive. The toEnum function can be used to safely acquire an Millisecond value from an integer. Correspondingly, a Millisecond can be lowered to a plain integer with the fromEnum function.

Instances

#Hour Source

newtype Hour

An hour component for a time value.

The constructor is private as values for the type are restricted to the range 0 to 23, inclusive. The toEnum function can be used to safely acquire an Hour value from an integer. Correspondingly, an Hour can be lowered to a plain integer with the fromEnum function.

Instances