@@ -499,8 +499,11 @@ instance FromJSON ZonedTime where
499 parseJSON v = typeMismatch "ZonedTime" v
499 parseJSON v = typeMismatch "ZonedTime" v
501instance ToJSON UTCTime where
501instance ToJSON UTCTime where
502− toJSON t = String (pack (take 23 str ++ "Z"))
502+ toJSON t = String (pack (str ++ z : "Z"))
503+ where (str,(x:y:_)) = splitAt 22 $
503− where str = formatTime defaultTimeLocale "%FT%T%Q" t
504+ formatTime defaultTimeLocale "%FT%T.%q" t
506+ | otherwise = succ x
504 {-# INLINE toJSON #-}
507 {-# INLINE toJSON #-}
506instance FromJSON UTCTime where
509instance FromJSON UTCTime where