获取最近15天的开始日期和结束日期 [英] to get the start date and end date of last 15 days

查看:208
本文介绍了获取最近15天的开始日期和结束日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有8月,并将其划分为2个时隙,即1-15,16-31

然后,如果当前日期介于这些时段之间,则我应该获得开始日期和前15天的结束日期.
1.e当前日期为2010年8月20日,开始日期为2010年8月1日,结束日期为2010年8月15日

并且如果当前日期是2010年8月10日,那么我应该获得的开始日期将是2010年7月16日,结束日期将是2010年7月31日(根据包含days的月份)

Suppose I have Month august and divide it in 2 slot i.e 1-15 ,16-31

Then if the current date is coming in between of any these slot the I should get the start date and end of previous 15 days.
1.e current date is 20 august 2010 the the start date will be 1 august 2010 and end date will be 15 aug 2010

and if current date is 10 aug 2010 the the start date I should get will 16 july 2010 and end date will be 31 july 2010 according to the month containing days

推荐答案

您的问题毫无意义,8月10日如何为您提供7月的射程?除此之外,它与ASP.NET无关,这是一个基本的VB问题,您可以使用<和>日期类上的运算符来解决.或者只是检查一天,看看是否< 16,如果不是,则在第二个插槽中.这真的是基本的编程,您真的在做ASP.NET吗?我认为您需要购买一本基本的VB书籍并阅读.
Your question makes no sense, how does 10 Aug get you a range in July ? Apart from that, it has nothing to do with ASP.NET, it''s a basic VB question, you can use the < and > operators on the date class to work it out. Or just check the day and see if it''s < 16, if it''s not, it''s in the second slot. This is really basic programming, are you really doing ASP.NET ? I think you need to buy a basic VB book and read it.


听起来就像您正在处理一些Timesheet类应用程序一样.您所需要做的就是DateTime操作.因此,我刚刚与您共享,请使用以下属性 [ ^ ].

如果遇到问题,请发布您尝试解决该问题的代码.
Sound like you are working on some Timesheet kinda application. All you need is DateTime manipulations. As, I just shared with you, try it using these properties[^].

If you face issues, post the code you tried with the issue.


Niraj,
如果您正在寻找SQL,则可以查看本教程.

http://shivasoft.in/blog/sql/get -the-fortnight-start-and-end-date-sql-server/ [
Hi Niraj,
If you are loooking for SQL then you can check this tutorial.

http://shivasoft.in/blog/sql/get-the-fortnight-start-and-end-date-sql-server/[^]

And in case of C# or VB you can simply use logical operators.
If you want exact code then reply to this thread, I will try to help you.

Regards,
Jitendra Zaa


这篇关于获取最近15天的开始日期和结束日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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