RE: [Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-26 Thread Simon Marlow
On 25 January 2005 17:17, John Goerzen wrote: > On Tue, Jan 25, 2005 at 03:15:38PM -, Simon Marlow wrote: >> normalizeTimeDiff (and TimeDiff in general) is wrong. I wouldn't >> recommend using it. There's the TimeExts library in the lang >> package, which might be useful to you. > > I'm cur

Re: [Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-25 Thread John Goerzen
On Tue, Jan 25, 2005 at 03:15:38PM -, Simon Marlow wrote: > normalizeTimeDiff (and TimeDiff in general) is wrong. I wouldn't > recommend using it. There's the TimeExts library in the lang package, > which might be useful to you. I'm curious about that package. It's in my ghc source tree but

RE: [Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-25 Thread Simon Marlow
On 21 January 2005 21:50, John Goerzen wrote: > On 2005-01-21, Peter Simons <[EMAIL PROTECTED]> wrote: >>> 24 * ((fromIntegral $ tdDay td) + >>> 30 * ((fromIntegral $ tdMonth td) + >>> 365 * (fromIntegral $ tdYear td) >> >> I w

[Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread John Goerzen
On 2005-01-21, Peter Simons <[EMAIL PROTECTED]> wrote: > > 24 * ((fromIntegral $ tdDay td) + > > 30 * ((fromIntegral $ tdMonth td) + > > 365 * (fromIntegral $ tdYear td) > > I was wondering: Does this calculation account for leap

Re: [Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread Marcin 'Qrczak' Kowalczyk
Peter Simons <[EMAIL PROTECTED]> writes: > I was wondering: Does this calculation account for leap > years? Does it have to? C itself leaves unspecified the question whether its time calculations take leap seconds into account. All other systems I know of ignore leap seconds: POSIX C, Common Lisp

[Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread Peter Simons
John Goerzen writes: > timeDiffToSecs :: TimeDiff -> Integer > timeDiffToSecs td = > (fromIntegral $ tdSec td) + > 60 * ((fromIntegral $ tdMin td) + > 60 * ((fromIntegral $ tdHour td) + > 24 * ((fromIntegral $ tdDay td) + > 30 * ((from