您的位置: 首页 > 技术问答 > 使用python打印月份和日期 使用python打印月份和日期 分类: 技术问答 • 2022-03-28 13:04:41 问题描述: 我正在尝试在python中仅打印月份和日期,如下所示: I am trying to print only the month and date in python as following : 09-December 08-October 我该怎么办? 答 尝试一下 import datetime now = datetime.datetime.now() print now.strftime("%d-%B") 有关此的更多信息: strftime