[project @ 2005-01-26 13:27:44 by malcolm]
[haskell-directory.git] / System / Time.hsc
index ec1c2b8..d884e87 100644 (file)
@@ -377,7 +377,8 @@ foreign import ccall "&timezone" timezone :: Ptr CTime
 gmtoff x = do 
   dst <- (#peek struct tm,tm_isdst) x
   tz <- if dst then peek altzone else peek timezone
-  return (-fromIntegral tz)
+  let realToInteger = round . realToFrac :: Real a => a -> Integer
+  return (-fromIntegral (realToInteger tz))
 # else /* ! HAVE_DECL_ALTZONE */
 
 #if !defined(mingw32_TARGET_OS)
@@ -642,7 +643,6 @@ show2' x
  where x' = x `rem` 100
 
 show3 x = show (x `quot` 100) ++ show2 (x `rem` 100)
- where x' = x `rem` 1000
 
 to12 :: Int -> Int
 to12 h = let h' = h `mod` 12 in if h' == 0 then 12 else h'