Advertisement
MartisK

Untitled

Oct 14th, 2020
794
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. foreach (var car in allCars)
  2.     {
  3.         int firstCheck = DateTime.Compare(currentDate, car.TechnicalInspectionDate);
  4.         int secondCheck = (car.TechnicalInspectionDate - currentDate).TotalDays;
  5.         if (DateTime.Compare(currentDate, car.TechnicalInspectionDate) >= 0 || (car.TechnicalInspectionDate - currentDate).TotalDays <= 30)
  6.         {
  7.             result.Add(car);
  8.         }
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement