Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- data Timestamp = Timestamp {}
- fromEpochMillisecond :: Int64 -> Timestamp
- now :: IO Timestamp
- addSec :: Int64 -> Timestamp -> Timestamp
- parseTimestamp :: String -> Maybe Timestamp
- fromS :: String -> Timestamp
- fromZonedTime :: ZonedTime -> Timestamp
- fromUTCTime :: UTCTime -> Timestamp
- fromSystemTime :: SystemTime -> Timestamp
- fromLocalTime :: LocalTime -> Timestamp
- showEpochTime :: Timestamp -> Text
The type
Timestamp when graph elements are observed.
Construction
Manipulation
addSec :: Int64 -> Timestamp -> Timestamp Source #
Add time difference (in seconds) to the Timestamp
.
Since: 0.2.0.0
Conversion
parseTimestamp :: String -> Maybe Timestamp Source #
Parse a string into Timestamp
. The format is like ISO8601 with
a little relaxation.
>>>
let timeAndOffset ts = (epochTime ts, fmap timeZoneMinutes $ timeZone ts)
>>>
fmap timeAndOffset $ parseTimestamp "2018-10-11T11:20:10"
Just (1539256810000,Nothing)>>>
fmap timeAndOffset $ parseTimestamp "2018-10-11 11:20:10"
Just (1539256810000,Nothing)>>>
fmap timeAndOffset $ parseTimestamp "2015-03-23 03:33Z"
Just (1427081580000,Just 0)>>>
fmap timeAndOffset $ parseTimestamp "1999-01-05 20:34:44.211+09:00"
Just (915536084211,Just 540)>>>
fmap timeAndOffset $ parseTimestamp "2007/08/20T22:25-07:00"
Just (1187673900000,Just (-420))
Since: 0.2.0.0
fromZonedTime :: ZonedTime -> Timestamp Source #
Since: 0.2.0.0
fromUTCTime :: UTCTime -> Timestamp Source #
Since: 0.2.0.0
fromSystemTime :: SystemTime -> Timestamp Source #
Since: 0.2.0.0
fromLocalTime :: LocalTime -> Timestamp Source #