@@ -616,13 +616,13 @@ instance FromJSON DotNetTime where
616616deriving instance Eq ZonedTime
617617
618618instance ToJSON ZonedTime where
619− toJSON t = String $ pack $ formattedTime
619+ toJSON t = String $ pack $ formatTime defaultTimeLocale format t
620620 where
621− formattedTime
622− | 0 == timeZoneMinutes (zonedTimeZone t) =
623− formatTime defaultTimeLocale "%FT%T%QZ" t
624− | otherwise =
625− formatTime defaultTimeLocale "%FT%T%Q%z" t
621+ format = "%FT%T" ++ milliseconds ++ tzFormat
622+ milliseconds = take 4 $ formatTime defaultTimeLocale "%Q" t
623+ tzFormat
624+ | 0 == timeZoneMinutes (zonedTimeZone t) = "Z"
625+ | otherwise = "%z"
626626
627627instance FromJSON ZonedTime where
628628 parseJSON (String t) =