convert integer to datetime in python

Solutions on MaxInterview for convert integer to datetime in python by the best coders in the world

showing results for - "convert integer to datetime in python"
Emil
20 Feb 2017
1>>> import datetime
2>>> your_timestamp = 1331856000000
3>>> date = datetime.datetime.fromtimestamp(your_timestamp / 1e3)
4
5>>> date
6datetime.datetime(2012, 3, 16, 1, 0)
7