📅  最后修改于: 2022-03-11 14:45:38.132000             🧑  作者: Mango
import datetime
today = datetime.date.today()
first = today.replace(day=1)
lastMonth = first - datetime.timedelta(days=1)
print(lastMonth.strftime("%Y%m"))