【发布时间】:2012-06-01 22:55:47
【问题描述】:
我需要获取自创建元素以来经过了多少秒,该元素作为日期时间元素存储在数据存储区(Google App Engine)中。我正在使用日期时间变量。但我无法将时差转换为秒。 (Python 2.7)
这是我的目标:
def time_difference(datetime_time):
return int(datetime.now()-datetime_time) #result should be in seconds like 612
非常感谢!
【问题讨论】:
标签: google-app-engine python-2.7 unix-timestamp seconds