你可以这样做 python 3
python 3
import time,datetime currentDT = datetime.datetime.now() currentmonth=currentDT.strftime("%B") nextmonth = datetime.date.today().month + 1 print(time.strftime('%B', time.struct_time((0, nextmonth, 0,)+(0,)*6)))