Answers for "time stamp to date python"

9

timestamp to date python

from datetime import datetime

timestamp = 1586507536367
dt_object = datetime.fromtimestamp(timestamp)
Posted by: Guest on April-10-2020
0

Python date to timestamp

>>> import time
>>> import datetime
>>> s = "01/12/2011"
>>> time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple())
1322697600.0
Posted by: Guest on July-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language