Getting first day of month in dot net using C#

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under Visual Studio category on | Points: 40 | Views : 471
Here is the code,
public DateTime Get_First_Day_Of_Month(DateTime dt)
{
return new DateTime(dt.Year, dt.Month, 1);
}

Response.Write(Get_First_Day_Of_Month(DateTime.Now) + "<br/>"); 

01/05/2015 12:00:00 AM

Comments or Responses

Login to post response