2015-01-20 77 views
0

我与eveapi为游戏工作在线前夕 https://github.com/ntt/eveapi http://wiki.eve-id.net/APIv2_Account_APIKeyInfo_XML蟒蛇eveapi转换的截止日期

现在我能得到通过运行到期的API的日期如下:

import eveapi 
api = eveapi.EVEAPIConnection() 
auth = api.auth(keyID=4055832, vCode="W7LF0Q8mqgYGpAbLiZgeO6bCpQq1PZ4rbgvlt8nyM4Iy1giko38rAJtEE8WuJ5wT") 
expires = auth.account.APIKeyInfo().key.expires 

但这将返回以下数字1453327533 如何将其转换为实际日期?

回答

0

数量是fromtimestamp(因为UNIX时代的秒数,1970年1月1日) 所以让你简单地做的日期时间:

from datetime import datetime 
datetime.fromtimestamp(int(expires))