The idea of Jesus's omniscience is a dividing point between Catholic and many Protestants. The Catholics hold that the doctrine of 'kenosis' is a heresy, even though Peter says Jesus 'humbled" or "emptied" himself.
The Catholic position, that there was no difference in the two natures of Jesus, leads some to wild speculations that baby Jesus could fly and give life to clay birds.
Some non-Catholics go so far as to say that his two natures were so different that Jesus was merely a man who possessed a divine spirit. Neither of these positions satisfy the demands of a comprehensive doctrine on the subject.
The middle ground is probably closer to the truth. He was the pre-incarnate Word, also known as the un-begotten Son. He then 'humbled' or emptied himself as he became a baby. Consider closing your eyes. you do not become blind but simply choose not to use sight.
So the Word chose to 'close his eyes' to his divinity and operate fully in the flesh... able to 'open his eyes at any time.
This is part of his temptation. Would he have to face the cross, or could by his divine nature, figure out another way.
If he had given in and 'opened his eyes' he would forfeit the position as our high priest, who was tempted in every way that we are, but did not sin. If he used divine power to resist sin, then he would not really understand our temptation.
So before becoming incarnate, he wrote notes for himself in the "mystery hidden from the beginning". To understand the mystery he had to approach the scriptures as a little child: in trust, asking questions, and without filters.
Through the notes he left himself in the OT. He discovered who he was, and what he was to do. He chose to be obedient to what he discovered there. He had to decide to be the savior of Israel at the wedding of Cana, and to be the savior of the gentiles in his encounter with the Samaritan woman. He had to choose to die, though his flesh resisted.
He knew God's plan as revealed in the mystery. He was often surprised by the means of the Father's will being accomplished. The 'miracles' and signs were not to convince the masses. After all, he taught in parables so that they would not believe.
They were a dialog between Father and son where a 'dinner theater' was being acted out in the literal history, which was shadow of the cross. Jesus would choose to participate in the 'play' showing that he understood his role in the cross, and the Father would do the miracle as an encouragement to him to continue toward the cross.
Jesus said that he would only perform one sign, in his own strength, and that was the sign of his own resurrection, which he accomplished by opening his eyes to his divinity.
His knowledge of the future was only that contained in the 'mystery', some are stated purposes and some are quite detailed in methods. But he himself did not know the day of his coming.
I upvoted Dave's answer because it is more direct, and added this as 'color'.