views:

104

answers:

2

I need two or one (out) C# method that will take any datetime and return the start date of year and end date of year for that year.

Not a homework (;-)

+4  A: 
void Dates(DateTime d, out DateTime b, out DateDime e)
{
    b = new DateTime(d.Year, 1, 1);
    e = new DateTime(d.Year, 12, 31);
}
Yossarian
I thought this was some kind of a joke :)
Yossarian
heeee............
abmv
A: 
DateTime startDate = new DateTime(year, 1, 1);
DateTime endDate = new DateTime(year, 12, 31);
Darin Dimitrov