from datetime import date,timedelta today = date.today() ww=today.strftime('%Y%U') https://m.runoob.com/python/att-time-strftime.html