<分区>
Possible Duplicate:
How to get the last day of a month?
到目前为止,我有这个:
DateTime createDate = new DateTime(year, month, 1).AddMonths(1).AddDays(-1);
有没有更好的办法?
<分区>
Possible Duplicate:
How to get the last day of a month?
到目前为止,我有这个:
DateTime createDate = new DateTime(year, month, 1).AddMonths(1).AddDays(-1);
有没有更好的办法?
最佳答案
如何使用 DaysInMonth
:
DateTime createDate = new DateTime (year, month,
DateTime.DaysInMonth(year, month));
( self 注意 - 必须在 Noda Time 中简化此操作 ...)
关于c# - 你如何找到这个月的最后一天?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4078954/