Permalink
Browse files

Miscellaneous Time Improvements

Sadly, it's not a fix either.  However,  AFAICT, there really isn't
any reason why a column in Postgres should not be declared as a
timestamp without time zone.  The behavior of such a column makes
absolutely no sense to me.
  • Loading branch information...
1 parent 7ebdb14 commit efd4c37340acee71a94bc91d4537343cc7317a4c @lpsmith committed Nov 9, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 Database/PostgreSQL/Simple/Param.hs
  2. +1 −1 Database/PostgreSQL/Simple/Result.hs
View
2 Database/PostgreSQL/Simple/Param.hs
@@ -180,7 +180,7 @@ instance Param LT.Text where
{-# INLINE render #-}
instance Param UTCTime where
- render = Plain . Utf8.fromString . formatTime defaultTimeLocale "'%F %T'"
+ render = Plain . Utf8.fromString . formatTime defaultTimeLocale "'%F %T%Q+00'"
{-# INLINE render #-}
instance Param Day where
View
2 Database/PostgreSQL/Simple/Result.hs
@@ -172,7 +172,7 @@ instance Result UTCTime where
case parseTime defaultTimeLocale "%F %T%Q" (B8.unpack bs) of
Just t -> t
Nothing -> conversionFailed f "UTCTime" "could not parse"
- where ok = mkCompats [Timestamp]
+ where ok = mkCompats [TimestampWithZone]
instance Result Day where
convert f = flip (atto ok) f $ date

0 comments on commit efd4c37

Please sign in to comment.