Skip to content
Snippets Groups Projects
Unverified Commit a3480984 authored by Ashley Yakeley's avatar Ashley Yakeley Committed by GitHub
Browse files

Merge pull request #108 from nh2/issue-106-docs-add-posix-nanos-example

haddocks: Example how to obtain POSIX int timestamps.
parents 3c9978ce e064f816
No related branches found
No related tags found
No related merge requests found
-- | POSIX time, if you need to deal with timestamps and the like.
-- Most people won't need this module.
--
-- If you want to convert POSIX time to integer/word timestamps,
-- consider the following example:
--
-- > import Data.Time.Clock (UTCTime, getCurrentTime, nominalDiffTimeToSeconds)
-- > import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)
-- > import Data.Int (Int64)
-- >
-- > nanosSinceEpoch :: UTCTime -> Int64
-- > nanosSinceEpoch =
-- > floor . (1e9 *) . nominalDiffTimeToSeconds . utcTimeToPOSIXSeconds
-- >
-- > main :: IO ()
-- > main = do
-- > u <- getCurrentTime :: IO UTCTime
-- > print (nanosSinceEpoch u)
module Data.Time.Clock.POSIX
(
posixDayLength,POSIXTime,posixSecondsToUTCTime,utcTimeToPOSIXSeconds,getPOSIXTime,getCurrentTime,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment