Ensures timestamps sent to Drive are always RFC3339 compliant
@@ -116,8 +116,8 @@ class Drive(object):
'mimeType': THUMBNAIL_MIME_TYPE
}
},
- 'createdTime': snapshot.date().isoformat(timespec='seconds'),
- 'modifiedTime': snapshot.date().isoformat(timespec='seconds')
+ 'createdTime': self._timeToRfc3339String(snapshot.date()),
+ 'modifiedTime': self._timeToRfc3339String(snapshot.date())
}
response = requests.get(download_url, stream=True, headers=HEADERS)
stream = ResponseStream(response.iter_content(262144))
@@ -143,6 +143,9 @@ class Drive(object):
print("Deleted snapshot backup from drive '{}'".format(snapshot.name()))
snapshot.driveitem = None
+ def _timeToRfc3339String(self, time):
+ return time.strftime("%Y-%m-%dT%H:%M:%SZ")
+
def readSnapshots(self, parent_id):
snapshots = []
