How to find last day of a month.
Response.Write(System.DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month));
Thanks - I always got the date of the first day of the next month then did AddDays(-1).
Didn't know about DaysInMonth.
Thanks, I've never noticed there's a such method!
I didnt know about this...really its too useful Thanks
very usefull thanks
Thanks Suthish Nair
It working fine.
its working.
Try this code...It may help you.
DateTime lastDay = DateTime.Today.AddMonths(1).AddDays(-1);
thx for the tip
It doesn´t work, for example, in February
DateTime lastDay = DateTime.Today.AddMonths(1).AddDays(-1)
I prefer
System.DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)
its useful