We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ec5990 commit 4947322Copy full SHA for 4947322
src/cmd-import
@@ -231,10 +231,12 @@ def skopeo_inspect(image):
231
def parse_timestamp(timestamp):
232
# datetime's doesn't support nanoseconds.
233
# So trim it.
234
- if len(timestamp) > 26 and timestamp[19] == '.':
235
- timestamp = timestamp[:26] + "Z"
+ # ignore the microseconds too, as not all images has it.
+ timestamp, _, _ = timestamp.partition('.')
236
+ if not timestamp.endswith('Z'):
237
+ timestamp += 'Z'
238
- timestamp = datetime.datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ')
239
+ timestamp = datetime.datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%SZ')
240
return rfc3339_time(timestamp.replace(tzinfo=datetime.timezone.utc))
241
242
0 commit comments