In the beginning of Deathly Hallows we have the following statement:
"The Trace'll break on the thirty-first," said Harry.
On the morning of his birthday we have the following passage (my emphasis):
"I try not to either," said Ron. "Well, happy birthday anyway."
"Wow — that's right, I forgot! I'm seventeen!"
Harry seized the wand lying beside his bed, pointed it at the cluttered desk where he had left his glasses, and said, "Accio Glasses!" Although they were only around a foot away, there was something immensely satisfying about seeing them zoom toward him, at least until they poked him in the eye.
"Slick," snorted Ron.
Reveling in the removal of his Trace, Harry sent Ron's possessions flying around the room, causing Pigwidgeon to wake up and flutter excitedly around his cage.
So, if the Trace breaks on the thirty-first, and the Trace breaks on Harry's birthday, the transitive property tells us that Harry's birthday must be the thirty-first.