This problem has been making the round on the internet. The solution provided gives one answer, and I don't disagree with the logic to arrive at that answer. However, it seems to me that there is at least one additional solution.
I will post the problem before the given solution or mine so as not to ruin it for you if you want to attempt yourself first:
The official solution says the birthday is July 16th. As I said, I don't disagree with the logic, however it seems to me that Aug 17th is also a viable solution. Here's my thinking:
If B was initially told the birthday was on the 17th he would not know the correct date. A, having been told the month was August, would know that B couldn't possible know the correct date, but would also have to admit that he didn't know. However, by admitting that he doesn't know the birthday, B would immediately know that Aug 17th was correct. This is because if June was the correct month, A would have known the birthday was June 17 (since A knows B doesn't know, and there is only one possible 18 date, A would know it was June 17). Since A doesn't know, B can rule out June 17th, and now knows it must be the correct date. A, following the same logic, could then come to the same conclusion after B announces he knows.