import datetime
today = datetime.datetime.today()
year = today.year
month = today.month
本文介绍了一种使用Python的datetime模块来获取系统当前日期的方法,包括如何获取当前的年份和月份。
import datetime
today = datetime.datetime.today()
year = today.year
month = today.month
6894
705