timestamp = time.strftime( '%Y-%m-%d %H:%M:%S', time.localtime(timestamp) code example
Example 1: python print datetime
import datetime
print("Now:", datetime.datetime.now())
Example 2: python datetime milliseconds
from datetime import datetime
dt_obj = datetime.strptime('20.12.2016 09:38:42,76',
'%d.%m.%Y %H:%M:%S,%f')
millisec = dt_obj.timestamp() * 1000
print(millisec)