문제

This question already has an answer here:

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.

도움이 되었습니까?

해결책

void Dates(DateTime d, out DateTime b, out DateTime e)
{
    b = new DateTime(d.Year, 1, 1);
    e = new DateTime(d.Year, 12, 31);
}

다른 팁

DateTime startDate = new DateTime(year, 1, 1);
DateTime endDate = new DateTime(year, 12, 31);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top