Answers for "how to convert datetime to number in python"

1

convert integer to datetime in python

>>> import datetime
>>> your_timestamp = 1331856000000
>>> date = datetime.datetime.fromtimestamp(your_timestamp / 1e3)

>>> date
datetime.datetime(2012, 3, 16, 1, 0)
Posted by: Guest on July-05-2021
-1

convert date to datetime python

datetime.datetime.combine(datetime.datetime.now(), datetime.datetime.min.time())
Posted by: Guest on June-15-2021

Code answers related to "how to convert datetime to number in python"

Python Answers by Framework

Browse Popular Code Answers by Language