Get First Day and Last Day of Month - C#

Get First Day and Last Day of Month - C#

code snippet

c#
DateTime date = DateTime.Now;
var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);

"The best preparation for tomorrow is doing your best today"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.