You have to first tell the user the format of date they will have to enter in the text box (such as 'dd/mm/yyyy'). Its best to instead use a DateTimePicker control instead of textbox because then the user will click and choose the date where as if the user enters a date in a textbox they can make a mistake.
if let's say you are using a textbox, then in the event handler method where you are using the input you can use the following code:
DateTime dateTime1 = DateTime.Parse(textBox1.Text); DateTime dateTime2 = DateTime.parse(textBox2.Text);
if (dateTime1.Year != dateTime.Year)