I have two timestamps
starttime = '2020-10-13T13:42:01Z'
endtime = '2020-10-13T13:42:21Z'
When I convert it to datetime, the seconds of the timestamp changes
timestampstart = pd.to_datetime(starttime, format="%Y-%m-%dT%H:%M:%S%fZ")
timestampend = pd.to_datetime(endtime, format="%Y-%m-%dT%H:%M:%S%fZ")
print(timestampstart,timestampend)
2020-10-13 13:42:00.100000 2020-10-13 13:42:02.100000
My required output is
2020-10-13 13:42:01 2020-10-13 13:42:21
What is the problem? How can I tackle it?