#先获得时间数组格式的日期
threeDayAgo
=
(datetime.datetime.now()
-
datetime.timedelta(days
3
))
#转换为时间戳:
timeStamp
int
(time.mktime(threeDayAgo.timetuple()))
#转换为其他字符串格式:
otherStyleTime
threeDayAgo.strftime(
"%Y-%m-%d %H:%M:%S"
)
#注:timedelta()的参数有:days,hours,seconds,microseconds