var startDate = DateTime.Now.Date; var endOfMonth = startDate.AddMonths(1).AddDays(-1).Date; endOfMonth.Dump(); endOfMonth.Subtract(startDate).TotalDays.Dump(); endOfMonth = endOfMonth.AddMonths(1).AddDays(-1).Date; endOfMonth.Dump(); endOfMonth.Subtract(startDate).TotalDays.Dump(); endOfMonth = endOfMonth.AddMonths(1).AddDays(-1).Date; endOfMonth.Dump(); endOfMonth.Subtract(startDate).TotalDays.Dump(); $"{endOfMonth:d}".Dump(); endOfMonth.ToShortDateString().Dump(); $"{endOfMonth}".Dump(); endOfMonth.ToString().Dump();