Skip to content
Snippets Groups Projects
Commit 6a437d64 authored by Ashley Yakeley's avatar Ashley Yakeley
Browse files

Clean up documentation

parent 773b8c44
No related branches found
No related tags found
No related merge requests found
...@@ -16,9 +16,11 @@ import Control.DeepSeq ...@@ -16,9 +16,11 @@ import Control.DeepSeq
-- | This is a length of time, as measured by UTC. -- | This is a length of time, as measured by UTC.
-- It has a precision of 10^-12 s.
--
-- Conversion functions will treat it as seconds. -- Conversion functions will treat it as seconds.
-- For example, @(0.010 :: NominalDiffTime)@ corresponds to 10 milliseconds. -- For example, @(0.010 :: NominalDiffTime)@ corresponds to 10 milliseconds.
-- It has a precision of 10^-12 s. --
-- It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. -- It ignores leap-seconds, so it's not necessarily a fixed amount of clock time.
-- For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), -- For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day),
-- regardless of whether a leap-second intervened. -- regardless of whether a leap-second intervened.
......
-- | POSIX time, if you need to deal with timestamps and the like. -- | POSIX time, if you need to deal with timestamps and the like.
-- Most people won't need this module. -- Most people won't need this module.
-- --
-- If you want to convert POSIX time to integer/word timestamps, -- You can use 'POSIXTime' to obtain integer/word timestamps. For example:
-- consider the following example:
-- --
-- > import Data.Time.Clock (UTCTime, getCurrentTime, nominalDiffTimeToSeconds) -- > import Data.Time
-- > import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds) -- > import Data.Time.Clock.POSIX
-- > import Data.Int (Int64) -- > import Data.Int
-- > -- >
-- > nanosSinceEpoch :: UTCTime -> Int64 -- > nanosSinceEpoch :: UTCTime -> Int64
-- > nanosSinceEpoch = -- > nanosSinceEpoch =
-- > floor . (1e9 *) . nominalDiffTimeToSeconds . utcTimeToPOSIXSeconds -- > floor . (1e9 *) . nominalDiffTimeToSeconds . utcTimeToPOSIXSeconds
-- > -- >
-- > main :: IO () -- > main :: IO ()
-- > main = do -- > main = do
-- > u <- getCurrentTime :: IO UTCTime -- > u <- getCurrentTime
-- > print (nanosSinceEpoch u) -- > print $ nanosSinceEpoch u
module Data.Time.Clock.POSIX module Data.Time.Clock.POSIX
( (
posixDayLength,POSIXTime,posixSecondsToUTCTime,utcTimeToPOSIXSeconds,getPOSIXTime,getCurrentTime, 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