CSharp examples for System:DateTime Month
Gets the first day of month.
using System;/*from ww w .java 2s . c o m*/ public class Main{ /// <summary> /// Gets the first day of month. /// </summary> /// <param name="date">The date.</param> /// <returns></returns> public static DateTime GetFirstDayOfMonth(this DateTime date) { var firstDayOfMonth = new DateTime(date.Year, date.Month, 1); return firstDayOfMonth; } }