File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ it into a `cosa build`, as if one did `cosa build ostree`. One can then e.g.
7
7
'''
8
8
9
9
import argparse
10
- import datetime
10
+ from dateutil import ( parser , tz )
11
11
import json
12
12
import os
13
13
import subprocess
@@ -233,13 +233,8 @@ def skopeo_inspect(image):
233
233
234
234
235
235
def parse_timestamp (timestamp ):
236
- # datetime's doesn't support nanoseconds.
237
- # So trim it.
238
- if len (timestamp ) > 26 and timestamp [19 ] == '.' :
239
- timestamp = timestamp [:26 ] + "Z"
240
-
241
- timestamp = datetime .datetime .strptime (timestamp , '%Y-%m-%dT%H:%M:%S.%fZ' )
242
- return rfc3339_time (timestamp .replace (tzinfo = datetime .timezone .utc ))
236
+ timestamp = parser .parse (timestamp )
237
+ return rfc3339_time (timestamp .astimezone (tz .UTC ))
243
238
244
239
245
240
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments