Skip to main content
2 de 3
se eliminaron 28 caracteres en el cuerpo
Pikoh
  • 17.5k
  • 9
  • 41
  • 56

saber el primer dia y el ultimo dia del mes en c#

DateTime MesActual = new DateTime(DateTime.Now.Year, DateTime.Now.Month,1);
var anho = DateTime.Now.Year;
var _mes = DateTime.Now.Month;
var Ultimodiames = DateTime.DaysInMonth(anho, _mes);
DateTime MesTermina = MesActual.AddDays(Ultimodiames - 1);