How to get the name of each day in next month?

后端 未结 5 488
无人共我
无人共我 2021-01-23 01:35
DateTime dt = new DateTime();
dt = DateTime.Now.AddMonths(1);
int x = DateTime.DaysInMonth(dt.Year, dt.Month);
MessageBox.Show(x.ToString());  // works ok - 31
         


        
5条回答
  •  有刺的猬
    2021-01-23 01:42

    Try DateTime.ToString(format) method.

    DateTime dt = new DateTime();
    String dayName=dt.ToString("ffffd");
    

提交回复
热议问题