Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions System/Time.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ getClockTime = do
-- | @'addToClockTime' d t@ adds a time difference @d@ and a
-- clock time @t@ to yield a new clock time. The difference @d@
-- may be either positive or negative.

--
-- Strange things can happen when 'TimeDiff' has
-- non-zero months and years, including but not limited
-- to ±1 hour jump when passing in and out daylight saving time.
addToClockTime :: TimeDiff -> ClockTime -> ClockTime
addToClockTime (TimeDiff year mon day hour minute sec psec)
(TOD c_sec c_psec) =
Expand Down Expand Up @@ -315,8 +318,10 @@ diffClockTimes (TOD sa pa) (TOD sb pb) =
}


-- | converts a time difference to normal form.

-- | Converts a time difference to normal form.
--
-- This function assumes that each month contains exactly 30 days
-- and each year contains exactly 365 days, which is not true.
normalizeTimeDiff :: TimeDiff -> TimeDiff
-- FIXME: handle psecs properly
-- FIXME: ?should be called by formatTimeDiff automagically?
Expand Down