Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

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"
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #python #timestanp
ADD COMMENT
Topic
Name
2+2 =