hackage-db-2.1.3: Access cabal-install's Hackage database via Data.Map
Maintainersimons@cryp.to
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Hackage.DB.Utility

Description

 
Synopsis

Documentation

fromEpochTime :: EpochTime -> UTCTime Source #

Convert the the EpochTime used by the tar library into a standard UTCTime type.

toEpochTime :: UTCTime -> EpochTime Source #

Convert the standard UTCTime type into the EpochTime used by the tar library.

parseIso8601 :: MonadFail m => String -> m UTCTime Source #

Parse an UTC timestamp in extended ISO8601 format a standard UTCTime type. This function is useful to parse the "snapshot" identifier printed by cabal-install after a database update into a useable type. Combine with toEpochTime to obtain an EpochTime that can be passed to the Hackage DB reading code from this library.

>>> parseIso8601 "2018-12-21T13:17:40Z"
2018-12-21 13:17:40 UTC