我是靠谱客的博主 超级钢笔,这篇文章主要介绍python 昨天今天明天,现在分享给大家,希望可以做个参考。

today= datetime.date.today().strftime('%Y-%m-%d')

yesteday=(datetime.date.today() + datetime.timedelta(-1)).strftime('%Y-%m-%d')
bfesteday=(datetime.date.today() + datetime.timedelta(-2)).strftime('%Y-%m-%d')

now = datetime.datetime.now()

month_start = datetime.datetime(now.year, now.month, 1).strftime('%Y-%m-%d')
month_end = datetime.datetime(now.year, now.month, calendar.monthrange(now.year, now.month)[1]).strftime('%Y-%m-%d')

最后

以上就是超级钢笔最近收集整理的关于python 昨天今天明天的全部内容,更多相关python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(49)

评论列表共有 0 条评论

立即
投稿
返回
顶部