Skip to content

Commit 1cf3edc

Browse files
authored
Merge pull request #541 from phaazon/master
Document ZonedTime FromJSON instance.
2 parents 0e4341e + e227483 commit 1cf3edc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Data/Aeson/Types/FromJSON.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,17 @@ instance FromJSONKey LocalTime where
16711671
fromJSONKey = FromJSONKeyTextParser (Time.run Time.localTime)
16721672

16731673

1674+
-- | Supported string formats:
1675+
--
1676+
-- @YYYY-MM-DD HH:MM Z@
1677+
-- @YYYY-MM-DD HH:MM:SS Z@
1678+
-- @YYYY-MM-DD HH:MM:SS.SSS Z@
1679+
--
1680+
-- The first space may instead be a @T@, and the second space is
1681+
-- optional. The @Z@ represents UTC. The @Z@ may be replaced with a
1682+
-- time zone offset of the form @+0000@ or @-08:00@, where the first
1683+
-- two digits are hours, the @:@ is optional and the second two digits
1684+
-- (also optional) are minutes.
16741685
instance FromJSON ZonedTime where
16751686
parseJSON = withText "ZonedTime" (Time.run Time.zonedTime)
16761687

0 commit comments

Comments
 (0)