Question: "If Jesus was God, why did He not know when He would return?"
Answer: Speaking of Jesus' Second Coming, Matthew 24:36 (and Mark 13:32) tells us, No one knows about that day or hour, not even the angels in heaven, nor the Son, but only the Father.
When Jesus spoke these words to the disciples, even He had no knowledge of the date and time of His return. Although Jesus was fully God (John 1:1, 14), when He became a man, He voluntarily restricted the use of certain divine attributes (Philippians 2:68). He did not manifest them unless directed by the Father (John 4:34; 5:30; 6:38). He demonstrated His omniscience on several occasions (cf. John 2:25; 3:13), but He voluntarily restricted that omniscience to only those things God wanted Him to know during the days of His humanity (John 15:15). Such was the case regarding the knowledge of the date and time of His return. After He was resurrected, Jesus resumed His full divine knowledge (cf. Matthew 28:18; Acts 1:7).
Matthew 24:36 clearly states that the Father alone knows when Jesus' return will be. Verses such as John 5:30; 6:38; 8:28-29; 10:30; 12:49; 14:28, 31; and Matthew 26:39, 42 demonstrate Jesus' submission to the Father as well as their Oneness in the Godhead. Yes, they are both God. But some things Jesus had apparently chosen to "give up the rights" to be privy to during His earthly ministry (see Philippians 2:5-11). Jesus, now exalted in Heaven, surely knows all, including the timing of His Second Coming.