| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Data.PackStream.Timestamp
Description
Internal module. Not part of the public API.
Synopsis
- data PSTimestamp
- mptsFromPosixSeconds :: Int64 -> PSTimestamp
- mptsFromPosixSeconds2 :: Int64 -> Word32 -> Maybe PSTimestamp
- mptsToPosixSeconds2 :: PSTimestamp -> (Int64, Word32)
- mptsFromPosixNanoseconds :: Integer -> Maybe PSTimestamp
- mptsToPosixNanoseconds :: PSTimestamp -> Integer
- mptsToUTCTime :: PSTimestamp -> UTCTime
- mptsFromUTCTime :: UTCTime -> Maybe PSTimestamp
- mptsFromUTCTimeLossy :: UTCTime -> PSTimestamp
Documentation
data PSTimestamp Source #
A PackStream timestamp
The representable range is [-292277022657-01-27 08:29:52 UTC .. 292277026596-12-04 15:30:07.999999999 UTC] with nanosecond precision.
Instances
mptsFromPosixSeconds :: Int64 -> PSTimestamp Source #
Construct PSTimestamp from amount of integral seconds since Unix epoch
mptsFromPosixSeconds2 :: Int64 -> Word32 -> Maybe PSTimestamp Source #
Construct PSTimestamp from amount of seconds and nanoseconds (must be \( \leq 10^9 \) ) passed since Unix epoch
mptsToPosixSeconds2 :: PSTimestamp -> (Int64, Word32) Source #
Deconstruct PSTimestamp into amount of seconds and nanoseconds passed since Unix epoch
mptsFromPosixNanoseconds :: Integer -> Maybe PSTimestamp Source #
Construct PSTimestamp from total amount of nanoseconds passed since Unix epoch
mptsToPosixNanoseconds :: PSTimestamp -> Integer Source #
Deconstruct PSTimestamp into total amount of nanoseconds passed since Unix epoch
mptsToUTCTime :: PSTimestamp -> UTCTime Source #
Convert PSTimestamp into UTCTime
mptsFromUTCTime :: UTCTime -> Maybe PSTimestamp Source #
Convert UTCTime into PSTimestamp
This conversion can fail (i.e. result in Nothing) if either the conversion cannot be performed lossless, either because the range of PSTimestamp was exceeded or because of sub-nanosecond fractions.
See also mptsFromUTCTimeLossy
mptsFromUTCTimeLossy :: UTCTime -> PSTimestamp Source #
Version of mptsFromUTCTime which performs a lossy conversion into PSTimestamp
- sub-nanosecond precision is silently truncated (in the sense of
floor) to nanosecond precision - time values exceeding the range of
PSTimestampare clamped tominBoundandmaxBoundrespectively