跳过日期或日期VB.NET [英] Skip Day or Date VB.NET

查看:106
本文介绍了跳过日期或日期VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何在两个日期之间跳过日期或日期.从dateStart到EndDate.并计算总的天数"

请帮助,谢谢.
问候,
Lad

Hi To All,

How to Skip Day or Date Between two Dates. From dateStart to EndDate. And compute the total "Days"

Please help,thanks in advance.
Regards,
Lad

推荐答案

您只想知道日期之间的差异.有几种方法:

http://msdn.microsoft.com/en-us/library/ms127413.aspx [ ^ ]

或者您可以使用TimeSpan

http://msdn.microsoft.com/en-us/library/system.timespan.aspx [^ ]

此外,您可以只使用循环或使用以下方法进行迭代:

You just want to know the difference between dates. There''s a few ways:

http://msdn.microsoft.com/en-us/library/ms127413.aspx[^]

or you can use TimeSpan

http://msdn.microsoft.com/en-us/library/system.timespan.aspx[^]

also, you can just use a loop or iterate using:

DateTime iterator = startDate;

while (iterator < endDate)
{
//Do work here.
DateTime iterator = iterator.AddDays(1);
}


这篇关于跳过日期或日期VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆