Nearest completed quarter

2020-03-01 09:21发布

Is there a C# function which will give me the last day of the most recently finished Quarter given a date?

For example,

var lastDayOfLastQuarter = SomeFunction(jan 3, 2010);

would set lastDayOfLastQuarter = Dec 31, 2009

标签: c# .net date
7条回答
Bombasti
2楼-- · 2020-03-01 10:07

You can use a simple switch statement to check which quarter the given date falls and return the last day of that quarter.

查看更多
登录 后发表回答