如何在 for
循环中使用 datetime
?
有两个变量duedate
和returndate
,返回日期为当前日期,duedate加1天等于returndate。
如何在 for 循环中使用它?
最佳答案
你可以使用:
DateTime start = ...;
DateTime finish = ...;
for (DateTime x = start; x <= finish; x = x.AddDays(1))
{
... // use x
}
关于c# - 如何在 for 循环中使用日期时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5179244/