from datetime import datetime
import time
month = datetime.now().month
month = f"{month:02d}"
year = datetime.now().year
print(year,month, type(year))
time.sleep(1000)
参考
https://stackoverflow.com/questions/15509345/extracting-double-digit-months-and-days-from-a-python-date



