I have a date in a string “2022-02-16” format yyyy-MM-dd i just want to do a comparison with the day and month but not the year. I want to check to see if the date is before or after today’s date just based off or the day and month.
For example “2022-02-16” would be considered a past date based off of the day and month and “2022-04-16” would be considered a future date based off of the day and month if we were comparing it to today. is there a way to do this without taking the year into consideration?
As you would need to neglect the year comparison, you could substitute the Current Year in the Input String itself and then Perform the Comparison with Current Date. As the input string is in the form yyyy-MM-dd, CDate() should directly convert it to the DateTime format.