BeginningOfTheMonth

public static DateTime BeginningOfTheMonth(this DateTime date)
{
	return new DateTime(date.Year, date.Month, 1);
}
Example:
var firstDay = DateTime.Now.BeginningOfTheMonth();

Description

Returns datetime corresponding to first day of the month

Details

Double click on the code to select all.

 

;