@@ -497,8 +497,9 @@ instance FromJSON ZonedTime where
497 parseJSON v = typeMismatch "ZonedTime" v
497 parseJSON v = typeMismatch "ZonedTime" v
499instance ToJSON UTCTime where
499instance ToJSON UTCTime where
500− toJSON t = String (pack (take 23 str ++ "Z"))
501− where str = formatTime defaultTimeLocale "%FT%T.%q" t
500+ toJSON t = String $ pack $ formatTime defaultTimeLocale format t
502+ format = "%FT%T." ++ formatMillis t ++ "Z"
502 {-# INLINE toJSON #-}
503 {-# INLINE toJSON #-}
504instance FromJSON UTCTime where
505instance FromJSON UTCTime where