@@ -50,11 +50,16 @@ data TimeOfDay64 = TOD {-# UNPACK #-} !Int
50 {-# UNPACK #-} !Int
50 {-# UNPACK #-} !Int
51 {-# UNPACK #-} !Int64
51 {-# UNPACK #-} !Int64
53+posixDayLength :: DiffTime
54+posixDayLength = fromInteger 86400
53diffTimeOfDay64 :: DiffTime -> TimeOfDay64
56diffTimeOfDay64 :: DiffTime -> TimeOfDay64
58+ | t >= posixDayLength = TOD 23 59 (60000000000000 + (unsafeCoerce (t - posixDayLength)))
54−diffTimeOfDay64 t = TOD (fromIntegral h) (fromIntegral m) s
59+ | otherwise = TOD (fromIntegral h) (fromIntegral m) s
55− where (h,mp) = fromIntegral pico `quotRem` 3600000000000000
60+ where (h,mp) = fromIntegral pico `quotRem` 3600000000000000
56− (m,s) = mp `quotRem` 60000000000000
61+ (m,s) = mp `quotRem` 60000000000000
57− pico = unsafeCoerce t :: Integer
62+ pico = unsafeCoerce t :: Integer
59toTimeOfDay64 :: TimeOfDay -> TimeOfDay64
64toTimeOfDay64 :: TimeOfDay -> TimeOfDay64
60toTimeOfDay64 (TimeOfDay h m s) = TOD h m (fromIntegral (fromPico s))
65toTimeOfDay64 (TimeOfDay h m s) = TOD h m (fromIntegral (fromPico s))