【发布时间】:2012-06-22 22:48:04
【问题描述】:
我确信有更简单的方法可以做到这一点,但我不确定为什么我不断收到 TypeError。
import datetime
getdate = datetime.date.today()
thirty = datetime.timedelta(days=30)
last_month = getdate - thirty
print json.dumps(api.get_zone_stats(3, "daily", "%s", "%s" %(last_month, getdate)))
Traceback(最近一次调用最后一次): ...
TypeError:字符串格式化期间并非所有参数都转换了
【问题讨论】:
标签: python string datetime string-formatting netdna-api