如何从当前日期获取最后四周并将其添加到下拉列表中 [英] How to get the last four weeks from current date and add it to dropdown list weekwise

查看:65
本文介绍了如何从当前日期获取最后四周并将其添加到下拉列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想从当前日期检索过去四周,然后在周边将其添加到下拉列表框中。谁能帮我。或者只是通过解释来给我提供示例代码。我得到了一些解决方案但有点困惑。请帮帮我。





提前致谢.....

解决方案

 DateTime lastWeek = DateTime.Now.AddDays(-7); 
DateTime last2Week = DateTime.Now.AddDays(-14);
DateTime last3Week = DateTime.Now.AddDays(-21);
// ...你明白了


Hi All,

I want to retrieve the last four weeks from the current date and then add it to the dropdown list box weekwise. Can any one help me. Or just give me the sample code for doing this by explaining it. I got some solutions but little bit confused about it. Please help me.


Thanks in advance.....

解决方案

DateTime lastWeek = DateTime.Now.AddDays(-7);
DateTime last2Week = DateTime.Now.AddDays(-14);
DateTime last3Week = DateTime.Now.AddDays(-21);
// ... you get the point


这篇关于如何从当前日期获取最后四周并将其添加到下拉列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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