I am trying to add to an if condition current year
DateTime nowDate = DateTime.Today; if (ProgCMP != null && ProgCMP.ProgDate.Year == nowDate.Year) { HaveDataProg = true; }
I know ProgCMP.ProgDate.Year is 2023, I got it listed from model but I failed getting the year of current date to make the comparison. What shoukld be the approach, please