matterhorn-50200.11.0: Terminal client for the Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Matterhorn.TimeUtils

Synopsis

Documentation

lookupLocalTimeZone :: IO TimeZoneSeries Source #

Get the timezone series that should be used for converting UTC times into local times with appropriate DST adjustments.

startOfDay :: Maybe TimeZoneSeries -> UTCTime -> UTCTime Source #

The timestamp for the start of the day associated with the input timestamp. If timezone information is supplied, then the returned value will correspond to when the day started in that timezone; otherwise it is the start of the day in a timezone aligned with UTC.

justAfter :: ServerTime -> ServerTime Source #

Sometimes it is convenient to render a divider between messages; the justAfter function can be used to get a time that is after the input time but by such a small increment that there is unlikely to be anything between (or at) the result. Adding the divider using this timestamp value allows the general sorting based on timestamps to operate normally (whereas a type-match for a non-timestamp-entry in the sort operation would be considerably more complex).

justBefore :: ServerTime -> ServerTime Source #

Obtain a time value that is just moments before the input time; see the comment for the justAfter function for more details.

asLocalTime :: TimeZoneSeries -> UTCTime -> LocalTime Source #

Convert a UTC time value to a local time.

localTimeText :: Text -> LocalTime -> Text Source #

Local time in displayable format

originTime :: UTCTime Source #

Provides a time value that can be used when there are no other times available