The temple in Jerusalem began as an idea by King David:
". . . the king said to Nathan the prophet, 'See now, I dwell in a house of cedar, but the ark of God dwells inside tent curtains.' Then Nathan said to the king, 'Go, do all that is in your heart, for the Lord is with you.' " (2Samuel 7:1-3, NKJV throughout)
Although God allowed David to gather materials for his temple in Jerusalem, he did not want him to build it. The task of building it would be left to David's son Solomon:
"And David said to Solomon: 'My son, as for me, it was in my mind to build a house to the name of the Lord my God; but the word of the Lord came to me, saying, "You have shed much blood and have made great wars; you shall not build a house for My name, BECAUSE YOU HAVE SHED MUCH BLOOD ON THE EARTH IN MY SIGHT.
"Behold, a son shall be born to you . . . His name shall be Solomon, for I will give peace and quietness to Israel in his days. He shall build a house for My name . . . " ' " (1Chronicles 22:7-10)
Work was begun around 966 - 965 B.C. and was completed around 959 - 958 B.C. The building was built on the summit of Mount Moriah (1Chronicles 22:14, 29:4; 2Chronicles 3:1), on the east of the city, on the spot where Abraham was to offer up Isaac as a sacrifice to God (Genesis 22:1-14). Unfortunately, the temple was burned, pillaged and destroyed by King Nebuchadnezzar of Babylon in 586 B.C. (2Kings 24:13; 2Chronicles 36:7). He carried all its treasures back to Babylon.
What is known as Herod's temple in Jerusalem was built on the same location as the first one. The foundations were laid about 535 B.C. by Jewish exiles returning from captivity in Babylon. When Herod the Great became king of Judea "God's house" had stood for about five hundred years, and had suffered considerably from natural decay as well as from the assaults of hostile armies. Herod, desirous of gaining the favor of the Jews, proposed to rebuild it. The offer was accepted. Work began around 20 B.C. and was carried out at an enormous cost of labor and expense, and on a scale of surpassing splendor. Work on the building was still going on at the time of Jesus (John 2:16, John 2:19-21). It was finally completed in 65 A.D.
The second temple, however, was not long permitted to exist. The Roman legions took the city of Jerusalem by storm, and notwithstanding the strenuous efforts General (later Emperor) Titus made to preserve it, his soldiers set it on fire in several places. Its total destruction began on the 9th of Ab (Hebrew month), the very same day the destruction of the first temple began. Its demise was completed on Ab 10 in Hebrew year (civil) 3831, which corresponds to Sunday, August 5th in 70 A.D.