Skip to content

Commit

Permalink
Automatically parse '%Y-%m-%d' string args as dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fergal Walsh committed Jul 24, 2014
1 parent 1aaa928 commit d01be28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pico/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def from_json(v, extra_json_loaders=()):
}

json_loaders = [
lambda s: datetime.datetime.strptime(s, '%Y-%m-%d').date(),
lambda s: datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S'),
lambda s: datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%fZ')
]
Expand Down

0 comments on commit d01be28

Please sign in to comment.