current month end date in C# code example
Example 1: c# find start and end of month from object date
DateTime date = ...
var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);
Example 2: c# get current month number
System.DateTime moment = new System.DateTime(
1999, 1, 13, 3, 57, 32, 11);
int year = moment.Year;
int month = moment.Month;
int day = moment.Day;
int hour = moment.Hour;
int minute = moment.Minute;
int second = moment.Second;
int millisecond = moment.Millisecond;