[Haskell-cafe] formatTime doesn't work with local time ??

Brian Denheyer briand at aracnet.com
Wed Jan 20 10:42:56 EST 2010

On Wed, 20 Jan 2010 07:15:07 -0800
Brian Denheyer <briand at aracnet.com> wrote:

> My error:
>     Couldn't match expected type `T.UTCTime'
>            against inferred type `T.LocalTime'
>     In the second argument of `formatTime', namely `date'
>     In the expression: formatTime "%Y/%m/%e %k:%M:%S" date


I had defined :

formatTime = T.formatTime defaultTimeLocale

which used the T.formatTime for the UTCTime instance.  The following

 T.formatTime defaultTimeLocale "%Y/%m/%e %k:%M:%S" date

works just fine (date is Localtime)


More information about the Haskell-Cafe mailing list