#如需求是当前时间则去掉函数参数改写为datetime.datetime.now()
threeDayAgo = (now_time - datetime.timedelta(days =30))
# 转换为时间戳
timeStamp =int(time.mktime(threeDayAgo.timetuple()))
# 转换为其他字符串格式
otherStyleTime = threeDayAgo.strftime("%Y-%m-%d")
return otherStyleTime
a = late_time("2019-3-30")
print(a)# 打印2018-02-28
关于python显示日期函数和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息 , 记得收藏关注本站 。
推荐阅读
- linux下替换文件命令,linux 替换文件内容命令
- 武汉erp系统软件,erp系统软件排名
- 剑客游戏单机角色扮演,剑客小游戏
- flutter缓存网络数据,flutter存储
- python函数传参讲解 python函数怎么传参数
- 酷开电视怎么连接u盘,酷开电视连接u盘没反应
- sqlserver替换更新,sql 替换
- 笔记安装cad缺少net是什么,cad安装缺少net组件
- mysql怎么删除表命令 mysql删除表语句