This isn't complicated C# - but somehow I managed to mess it up... Here's the correct version!
var theDate = DateTime.UtcNow;
var daysInMonth = DateTime.DaysInMonth(theDate.Year, theDate.Month);
var daysLeftThisMonth = daysInMonth - theDate.Day;
var endOfCurrentMonth = theDate.AddDays(daysLeftThisMonth);
No comments:
Post a Comment