diff options
author | 2012-06-16 13:56:29 +0200 | |
---|---|---|
committer | 2012-06-16 13:58:12 +0200 | |
commit | 107b12b3b48040488ff6ddd54cb1300200dc8b37 (patch) | |
tree | f35c57bb8b5c5cd85511aaad1c0df0e4f97c0c25 /pygithub3/resources/base.py | |
parent | Merge #5 'services/orgs' (diff) | |
parent | Tests on services.issues working (diff) | |
download | python-github3-107b12b3b48040488ff6ddd54cb1300200dc8b37.tar.xz python-github3-107b12b3b48040488ff6ddd54cb1300200dc8b37.zip |
Merge #12 'services/issues'
Diffstat (limited to 'pygithub3/resources/base.py')
-rw-r--r-- | pygithub3/resources/base.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pygithub3/resources/base.py b/pygithub3/resources/base.py index 7045529..4c65b8b 100644 --- a/pygithub3/resources/base.py +++ b/pygithub3/resources/base.py @@ -1,8 +1,12 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- +from datetime import datetime + from pygithub3.core.utils import json +GITHUB_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' + class Resource(object): @@ -44,9 +48,8 @@ class Resource(object): return wrapper def parse_date(string_date): - from datetime import datetime try: - date = datetime.strptime(string_date, '%Y-%m-%dT%H:%M:%SZ') + date = datetime.strptime(string_date, GITHUB_DATE_FORMAT) except TypeError: date = None return date |