How do I determine if a date lies between current week dates?

前端 未结 4 1435
有刺的猬
有刺的猬 2021-01-26 20:49

In C#,

How we are check certain date with in week dates?

Eg: 6/02/2014

Current Weeks: 02/02/2014 - 08/02/2014

so this dates are with in above wee

4条回答
  •  失恋的感觉
    2021-01-26 21:19

    hmm

    public bool isBetween(DateTime input, DateTime date1, DateTime date2)
        {
            if (input > date1 && input < date2)
                return true;
            else
                return false;
        }
    

    ?

    input= your date date1 & date2 = start and end of a week

提交回复
热议问题