I am trying to find a time diff between two timestamp.
Code:
fmt = '%Y-%m-%d %H:%M:%S:%fZ'
tstamp1 = datetime.strptime(first_timestamp, fmt)
tstamp2 = datetime.strptime(second_timestamp, fmt)
td = tstamp1 - tstamp2
td_mins = int(round(td.total_seconds() / 60))
total_min = total_min + td_mins
But I am getting error as "time data '2022-04-20T05:42:05Z' does not match format '%Y-%m-%d*%H:%M:%S:%fZ'"
My timestamp are in format 2022-04-20T05:42:05Z - which is ISO 8601.
How to deal with this?