Chad Scherrer | 2 Oct 22:38 2006
Picon

DiffTime in Data.Time

I'm trying to use Data.Time, and I'm totally confused. DiffTime is
abstract, and I don't see anything that maps into it. How do I
construct one? I would like to then use the result to create a value
of type UTCTime, but it seems (currently) like this might be easier.

Thanks,

--

-- 

Chad Scherrer

"Time flies like an arrow; fruit flies like a banana" -- Groucho Marx
Ashley Yakeley | 3 Oct 03:21 2006

Re: DiffTime in Data.Time

Chad Scherrer wrote:
> I'm trying to use Data.Time, and I'm totally confused. DiffTime is
> abstract, and I don't see anything that maps into it. How do I
> construct one? I would like to then use the result to create a value
> of type UTCTime, but it seems (currently) like this might be easier.

It's an instance of Num etc. (as seconds).

--

-- 
Ashley Yakeley
Seattle WA
Chad Scherrer | 3 Oct 05:11 2006
Picon

Re: DiffTime in Data.Time

Ok, that's much simpler than I was making it. fromIntegral or
fromRational does the trick. Obvious in hindsight, I guess. Thanks!

-Chad

On 10/2/06, Ashley Yakeley <ashley <at> semantic.org> wrote:
> Chad Scherrer wrote:
> > I'm trying to use Data.Time, and I'm totally confused. DiffTime is
> > abstract, and I don't see anything that maps into it. How do I
> > construct one? I would like to then use the result to create a value
> > of type UTCTime, but it seems (currently) like this might be easier.
>
> It's an instance of Num etc. (as seconds).
>
> --
> Ashley Yakeley
> Seattle WA
>

--

Gmane