convert year to date python code example Example: doy to date python datetime.datetime(year, 1, 1) + datetime.timedelta(days - 1)