It always asks two times, the first time, it is invalid, the second time it is always correct. For example in the year > yearNow part. I understand that 2012 is assigned to yearNow. I even tried to output yearNow to the screen and found out that it is functioning properly. But when I type in 2012 to year, which is not less than 2012(yearNow), it goes to invalid input and asks for year again. This time when I input 2012, it goes on asking for the month. I'd say that it is a Logical error.
Your asking the user to input twice... no matter what. Change that to a while loop. Do while means "Run this at least once", which is exactly how you have written it.
1 2 3 4 5 6
cin >> year;
do
{
cout << "Invalid year! Please input year again: ";
cin >> year;
} while (year < yearNow);