@@ -72,12 +72,13 @@ seconds = do
7272 case mc of
7373 Just '.' -> do
7474 t <- anyChar *> takeWhile1 isDigit
75− return $! parsePicos real t
75+ return $! parsePicos (fromIntegral real) t
7676 _ -> return $! fromIntegral real
7777 where
78+ parsePicos :: Int64 -> B8.ByteString -> Pico
7879 parsePicos a0 t = toPico (fromIntegral (t' * 10^n))
79− where n = 12 - B8.length t
80− t' = B8.foldl' (\a c -> 10 * a + fromIntegral (ord c) .&. 15) a0
80+ where n = max 0 (12 - B8.length t)
81+ t' = B8.foldl' (\a c -> 10 * a + fromIntegral (ord c .&. 15)) a0
8182 (B8.take 12 t)
8283
8384-- | Parse a time zone, and return 'Nothing' if the offset from UTC is