The book of Zechariah is Narrative History, Prophetic and Apocalyptic in genre. It is a post-exilic book, meaning it was written after (post) the return from captivity (exile) in Babylon. The prophet Zechariah wrote chapters 1-8 approximately 520-518 B.C. (Before the temple completed), and then wrote chapters 9-14 approximately 480 B.C. (After the temple is completed). Zechariah is among the most precisely dated books in the Bible. Key personalities are Zechariah, Zerubbabel and Joshua.
The purpose of this book is that Zechariah wrote to encourage the remnant, who had recently returned from exile. Their faith in God was weak and they were not motivated to build the temple. They needed to learn and conform to the law of God again.