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

add missing file; README file; root Makefile clean fix

darcs-hash:20060206063647-ac6dd-e953bb4a546bdbadc1547fcc27f8f30f537eb435
parent f82aac1e
No related branches found
Tags 0.3
No related merge requests found
......@@ -19,6 +19,6 @@ doc: sources
haddock -h -o haddock `cat sources`
clean:
rm -f sources
rm -f sources haddock
cd time && make clean
cd fixed && make clean
README 0 → 100644
This contains two packages, "fixed" and "time". They can each be built with Cabal. "time" depends on "fixed".
cd fixed
runghc Setup.hs configure
runghc Setup.hs build
sudo runghc Setup.hs install
cd ..
cd time
runghc Setup.hs configure
runghc Setup.hs build
sudo runghc Setup.hs install
cd ..
You can use it with ghci:
$ ghci
Prelude> :m +Data.Time
Prelude Data.Time> t <- getCurrentTime
Prelude Data.Time> t
2006-02-06 06:31:43.859082 UTC
Prelude Data.Time> zt <- getZonedTime
Prelude Data.Time> zt
2006-02-05 22:32:32.948607 PST
{-# OPTIONS -Wall -Werror #-}
-- #hide
module Data.Time.Clock.UTCDiff where
import Data.Time.Clock.POSIX
import Data.Time.Clock.UTC
-- | addUTCTime a b = a + b
addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
addUTCTime x t = posixSecondsToUTCTime (x + (utcTimeToPOSIXSeconds t))
-- | diffUTCTime a b = a - b
diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
diffUTCTime a b = (utcTimeToPOSIXSeconds a) - (utcTimeToPOSIXSeconds b)
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