Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Module containing time conversion functions. These functions are assuming that there is never going to be a different slot or epoch length and project a slot/time accordingly.
See Hydra.Chain.Direct.TimeHandle for an alternative that uses the
cardano-node provided EraSummary
to do "correct" translation on time.
Synopsis
- slotNoToUTCTime :: SystemStart -> SlotLength -> SlotNo -> UTCTime
- slotNoFromUTCTime :: SystemStart -> SlotLength -> UTCTime -> SlotNo
Documentation
slotNoToUTCTime :: SystemStart -> SlotLength -> SlotNo -> UTCTime Source #
Convert a SlotNo
to a UTCTime
using given SystemStart
and
SlotLength
. This assumes the slot length never changes!
slotNoFromUTCTime :: SystemStart -> SlotLength -> UTCTime -> SlotNo Source #
Convert a UTCTime
to a SlotNo
using given SystemStart
and
SlotLength
. This assumes the slot length never changes! Also if the UTCTime
is before the systemStart it will truncate to slot 0.