I would first get the first day of the year and subtract one, like so:
DateTime lastDayOfPrevio usYear = (new DateTime(year, 1, 1)).AddDays(-1);
Then, you can add the number of days to the lastDayOfPrevio usYear and it
will give you the appropriate DateTime:
DateTime dateTime = lastDayOfPrevio usYear.AddDays( days);
Of course, you can just get the first date of the year, and subtract one
from the number of days, like so:
DateTime firstDayOfYear = new DateTime(year, 1, 1);
DateTime dateTime = firstDayOfYear. AddDays(days - 1);
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard. caspershouse.co m
"O.B." <fu******@bells outh.netwrote in message
news:11******** ************@e9 g2000prf.google groups.com...
Does C# provide an operation for converting year and day-of-the-year
(1-365) to a DateTime object?