projects
/
haskell-directory.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23ce9fa
)
addToClockTime: handle picoseconds properly
author
Simon Marlow
<simonmar@microsoft.com>
Fri, 10 Mar 2006 11:45:32 +0000
(11:45 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Fri, 10 Mar 2006 11:45:32 +0000
(11:45 +0000)
fixes #588
System/Time.hsc
patch
|
blob
|
history
diff --git
a/System/Time.hsc
b/System/Time.hsc
index
ff10ffc
..
f230e97
100644
(file)
--- a/
System/Time.hsc
+++ b/
System/Time.hsc
@@
-270,8
+270,8
@@
addToClockTime (TimeDiff year mon day hour min sec psec)
60 * toInteger min +
3600 * toInteger hour +
24 * 3600 * toInteger day
- cal = toUTCTime (TOD (c_sec + sec_diff) (c_psec + psec))
- -- FIXME! ^^^^
+ (d_sec, d_psec) = (c_psec + psec) `quotRem` 1000000000000
+ cal = toUTCTime (TOD (c_sec + sec_diff + d_sec) d_psec)
new_mon = fromEnum (ctMonth cal) + r_mon
month' = fst tmp
yr_diff = snd tmp