python - 将天数转换成日期
时间:2019-10-19 20:54:49
收藏:0
阅读:437
# 如果是 0 则为今天
def getdate(day): today = datetime.datetime.now() deviation = datetime.timedelta(days=-day) return (today + deviation).strftime(‘%Y-%m-%d %H:%S:%M‘) print(getdate(0))
原文:https://www.cnblogs.com/chaoqi/p/11704929.html
评论(0)