Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1397 from fivethreeo/develop

Amazon S3 date format
  • Loading branch information...
commit d8acad57e6f38b268e77f19d36af51b7d798ac14 2 parents c835004 + fee862a
@kopertop kopertop authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 boto/utils.py
View
11 boto/utils.py
@@ -378,7 +378,7 @@ def get_instance_userdata(version='latest', sep=None,
ISO8601 = '%Y-%m-%dT%H:%M:%SZ'
ISO8601_MS = '%Y-%m-%dT%H:%M:%S.%fZ'
-
+RFC1123 = '%a, %d %b %Y %H:%M:%S %Z'
def get_ts(ts=None):
if not ts:
@@ -392,9 +392,12 @@ def parse_ts(ts):
dt = datetime.datetime.strptime(ts, ISO8601)
return dt
except ValueError:
- dt = datetime.datetime.strptime(ts, ISO8601_MS)
- return dt
-
+ try:
+ dt = datetime.datetime.strptime(ts, ISO8601_MS)
+ return dt
+ except ValueError:
+ dt = datetime.datetime.strptime(ts, RFC1123)
+ return dt
def find_class(module_name, class_name=None):
if class_name:
Please sign in to comment.
Something went wrong with that request. Please try again.