shithub: MicroHs

ref: 5e4f9f0a07f9f3dfc9616dabdc4b720a995ff48b
dir: /cpphscompat/Data/Time/Clock.hs/

View raw version
-- A hack to be able to compile cpphs.
-- We need a proper package for this.
module Data.Time.Clock(
  UTCTime(..),
  getCurrentTime,
  ) where
import Prelude
import System.IO.TimeMilli

-- Second since 1970, probably
newtype UTCTime = UTCTime Int
  deriving (Show)

getCurrentTime :: IO UTCTime
getCurrentTime = do
  t <- getTimeMilli
  return $ UTCTime $ t `quot` 1000