import datetime today = datetime.datetime.now() thisYear = today.year firstDay = datetime.datetime(thisYear, 1, 1) firstDayStr = firstDay.strftime('%Y')