import datetime time = "2020-02-25T00:02:43.000Z" date = datetime.datetime.strptime(time, '%Y-%m-%dT%H:%M:%S.%fZ') timestamp = str((date - datetime.datetime(1970, 1, 1)).total_seconds()*1000) print(timestamp[:-2])