[Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Lyle Kopnicky
Hi folks, I had some code using the oldtime package, and want to convert it to use the time package. One of the things I need to do is calculate the number of seconds since midnight. The easy part is getting a TimeDiff result: utc - getCurrentTime tz - getCurrentTimeZone let td =

Re: [Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Philip Weaver
2008/11/12 Lyle Kopnicky [EMAIL PROTECTED] Hi folks, I had some code using the oldtime package, and want to convert it to use the time package. One of the things I need to do is calculate the number of seconds since midnight. The easy part is getting a TimeDiff result: utc -

Re: [Haskell-cafe] TimeDiff to Int?

2008-11-12 Thread Lyle Kopnicky
Thanks Philip and Roger, I think I'll use... floor $ toRational td ...although I could have sworn that didn't work last night. I don't see that TimeDiff has an instance of RealFrac, where floor is defined, though it does have a instances of Real and Fractional. Yes, the numeric classes are a