DateTime dt = DateTime.Now;
            //本月第一天时间      
            DateTime dt_First = dt.AddDays(1 - (dt.Day));
            //获得某年某月的天数    
            int year = dt.Date.Year;
            int month = dt.Date.Month;
            int dayCount = DateTime.DaysInMonth(year, month);
            //本月最后一天时间    
            DateTime dt_Last = dt_First.AddDays(dayCount - 1);
            dtpDateTime.Value = dt_First;
            dtpEndTime.Value = dt_Last;

 

相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2021-08-23
  • 2022-12-23
  • 2022-03-04
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案