Reputation:
I have the following python time value in JSON format...any inputs on how to convert it to to regular time format
u'lastUpdated': 1358294533
Upvotes: 0
Views: 70
Reputation: 9150
datetime.fromtimestamp from the datetime module should do it.
For example:
>>> from datetime import datetime
>>> d = datetime.fromtimestamp(1358294533)
>>> d.isoformat()
'2013-01-15T19:02:13'
For getting a more controlled string representation of the datetime use the datetime.strftime function.
Upvotes: 2