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
FWIW, BETWEEN is inclusive, not exclusive WRT to its bounds. Anyway, here you go:
public static bool Between(this DateTime instant, DateTime dtFrom , DateTime dtThru )
{
if (dtFrom > dtThru) throw new ArgumentException( "dtFrom may not be after dtThru", "dtFrom" );
bool isBetween = ( instant >= dtFrom && instant <= dtThru );
return isBetween;
}