Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Time/DiffClockTimes.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Time where

import DClockTime
import DTimeDiff

diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
diffClockTimes (CT t) (CT t') =
    TimeDiff { tdYear=0, tdMonth=0, tdDay=dd
             , tdHour=dh, tdMin=dm, tdSec=ds, tdPicosec=0 }
  where
    ts = t-t'
    (tm, ds) = quotRem ts 60
    (th, dm) = quotRem tm 60
    (dd, dh) = quotRem th 24
    -- tdMon and tdYear make no sense, so ignore them


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.