Answers for "python timestanp"

0

python timestanp

#!/usr/bin/python3
import time
import datetime

start = "10/03/2021 08:00:00"
timestmp_start=int(time.mktime(datetime.datetime.strptime(start, "%d/%m/%Y %H:%M:%S").timetuple()))*1000
date_start=datetime.datetime.fromtimestamp(timestmp_start/1000).strftime("%d/%m/%Y %H:%M:%S")


#output:
#timestmp_start: 1615343400000
#date_start: "10/03/2021 08:00:00"
Posted by: Guest on March-12-2021

Browse Popular Code Answers by Language