HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulehourglass-0.2.12Haskell2010

Data.Hourglass.Compat

Basic Time conversion compatibility.

This module aims to help conversion between the types from the package time to the package hourglass.

Example of use (extracted from file ExampleTimeCompat.hs):

import Data.Hourglass        as H
import Data.Hourglass.Compat as C
import Data.Time             as T

transpose :: T.ZonedTime
          -> H.LocalTime H.DateTime
transpose oldTime =
    H.localTime
        offsetTime
        (H.DateTime newDate timeofday)
  where
    newDate :: H.Date
    newDate = C.dateFromTAIEpoch $ T.toModifiedJulianDay $ T.localDay $ T.zonedTimeToLocalTime oldTime

    timeofday :: H.TimeOfDay
    timeofday = C.diffTimeToTimeOfDay $ T.timeOfDayToTime $ T.localTimeOfDay $ T.zonedTimeToLocalTime oldTime

    offsetTime = H.TimezoneOffset $ fromIntegral $ T.timeZoneMinutes $ T.zonedTimeZone oldTime

This module will be depreciated in favor of Time.Compat

    • Packagehourglass-0.2.12
    • Exports0
    • LanguageHaskell2010
    • LicenceBSD-3-Clause
    • SourceCompat.hs