convert integer to datetime in python

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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