Last day of the month in .NET

后端 未结 5 1716
闹比i
闹比i 2020-12-30 20:12

Normally I use the below code, but is there a better way?

lastOfMonth = new DateTime(Now.Year, Now.Month, 1).AddMonths(1).AddDays(-1)
5条回答
提交回复
热议问题