Answers for "number to date 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
0

how to get date in numbers using python

from datetime import datetime
shortDate = datetime.today().strftime('%Y-%m-%d')
Posted by: Guest on May-27-2020

Python Answers by Framework

Browse Popular Code Answers by Language