Problem : Getting first and last day of the month.
Solution :
// Get Last Day Of The Month
public static DateTime GetLastDayOfMonth(int year, int month)
{
return new DateTime(year, month, DateTime.DaysInMonth(year, month));
}
// Get 1 Day Of The Month
public static DateTime GetFirstDayOfMonth(int year, int month)
{
return new DateTime(year, month, 1);
}
C# Get 1 Day of The Month And Last Day of The Month
Posted by Unknown at 8/30/2013 11:46:00 am
Labels: ASP.net C#, C#
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment