Is there BETWEEN DateTime in C# just like SQL does?

前端 未结 9 1151
悲&欢浪女
悲&欢浪女 2021-01-01 09:13

Is there between DateTime in C# ? I know I can do simple check with if (a > date1 && a < date2) but I was trying to find Between meth

9条回答
  •  隐瞒了意图╮
    2021-01-01 09:37

    There is not, but if you obey number line formatting per Code Complete, the raw code looks simpler:

    if((lowDate < a) && (a < highDate)) 
    

提交回复
热议问题