I need to see output in above-mentioned format. I tried:
datetime.datetime.utcnow().isoformat()[:-4]
datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S:%f')[:-4]
it does not include Z
at the end.
Just add Z
datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S:%f')[:-4] + 'Z'