我怎样才能在15和30或31之间得到日期我正在创建一个加班表格我需要在15或30中设置付款期限。
Date Time pm5 = Date Time.Parse(date2)Add Days(15);
string mystring5;
mystring5 = pm5.To String("MM/dd/y y");
textBox44.Text = mystring5;
答案 0 :(得分:0)
这样的东西?
DateTime today = DateTime.Today;
DateTime payDay;
if(today.Day <= 15)
payDay = new DateTime(today.Year, today.Month, 15);
else
payDay = new DateTime(today.Year, today.Month, DateTime.DaysInMonth(today.Year, today.Month));