Python Question: Year and Day of Year to date?

Mino picture Mino · Mar 11, 2010 · Viewed 39.7k times · Source

I have a year value and a day of year and would like to convert to a date (day/month/year).

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Mar 11, 2010
datetime.datetime(year, 1, 1) + datetime.timedelta(days - 1)