Module

Data.DateTime.Instant

Package
purescript-datetime
Repository
purescript/purescript-datetime

#InstantSource

newtype Instant

An instant is a duration in milliseconds relative to the Unix epoch (1970-01-01 00:00:00 UTC).

The constructor is private as the Instant range matches that of the DateTime type.

Instances

#instantSource

instant :: Milliseconds -> Maybe Instant

Attempts to create an Instant from a Milliseconds duration. The minimum acceptable value equates to the bottom DateTime and the maximum acceptable value equates to the top DateTime.

#unInstantSource

unInstant :: Instant -> Milliseconds

Lowers an Instant to a Milliseconds duration.

#fromDateTimeSource

fromDateTime :: DateTime -> Instant

Creates an Instant from a DateTime value.

#toDateTimeSource

toDateTime :: Instant -> DateTime

Creates a DateTime value from an Instant.