c# date current year is within range code example Example: c# date current year is within range return dateToCheck >= startDate && dateToCheck < endDate;