Module

Temporal.Display

Package
purescript-temporal
Repository
philippedev101/purescript-temporal

Timezone-aware display helpers.

Convenience functions for converting instants to local representations and getting the current date/time in a specific timezone.

#toLocal Source

toLocal :: String -> Instant -> PlainDateTime

Convert an Instant to a PlainDateTime in the given IANA time zone.

Shorthand for toPlainDateTime (toZonedDateTimeISO tz inst).

toLocal "America/New_York" instant  -- wall-clock time in New York
toLocal "Asia/Tokyo" instant        -- wall-clock time in Tokyo

#toLocalDate Source

toLocalDate :: String -> Instant -> PlainDate

Convert an Instant to a PlainDate in the given IANA time zone.

#toLocalTime Source

toLocalTime :: String -> Instant -> PlainTime

Convert an Instant to a PlainTime in the given IANA time zone.

#todayIn Source

todayIn :: String -> Effect PlainDate

The current date in the given IANA time zone.

Alias for Now.plainDateISOIn.

#nowIn Source

nowIn :: String -> Effect PlainDateTime

The current date and time in the given IANA time zone.

Alias for Now.plainDateTimeISOIn.