在 Java文中获得时间
var ts = new Date().getTime()
迄今为止,我使用了以下代码:
>>> jsts = 1335205804950
>>> dt = datetime.datetime.fromtimestamp(jsts/1000)
>>> dt
datetime.datetime(2012, 4, 24, 0, 30, 4)
I divide timestamp by 1000 because I get error like
ValueError Traceback (most recent call last)
1 d = datetime.datetime.fromtimestamp(a)
ValueError: year is out of range