[Haskell-cafe] Re: HDBC converting a date sql value to UTCTime
George Moschovitis
george.moschovitis at gmail.com
Fri Jun 20 09:44:38 EDT 2008
Alternatively is there a way to create a UTCTime value from an epoch integer
(no of seconds since epoch).
I can't find a suitable constructor with Hoogle.
thank you in advance,
George.
On Thu, Jun 19, 2008 at 10:08 PM, George Moschovitis <
george.moschovitis at gmail.com> wrote:
> Hello,
>
> I am HDBC with the Postgres driver. I am trying to read a simple date
> column from the DB:
>
> stmt <- DB.prepare conn "SELECT date FROM my_table ORDER BY date DESC LIMIT
> 1"
> DB.execute stmt []
> DB.commit conn
> rows <- fetchAllRows' stmt
> let ((d:_):_) = rows
>
> the d variable is of type:
>
> SqlEpochTime 1213736400
>
> I am wondering how to convert this value to an UTCTime value.
>
> Any help appreciated (I am a newbie).
>
> -g.
>
>
>
> --
> http://gmosx.me.gr
> http://joy.gr
> http://cull.gr
> http://nitroproject.org
> http://phidz.com
> http://joyerz.com
--
Walt Disney - "I love Mickey Mouse more than any woman I have ever known."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080620/382bbbd4/attachment.htm
More information about the Haskell-Cafe
mailing list