Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要两个或一个(出)C# 方法,它们将采用任何日期时间并返回该年的开始日期和结束日期。
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);