Based on the contents of Zephaniah’s writing, the book must have been composed before the Fall of Nineveh, in 612 BC, shortly after the Chaldean revolt of 626 BC. The Chaldean revolt against the Assyrians captured Babylon in its first year and coronated Nabopolassar as King of Babylon. King Josiah switched allegiances quickly from Assyria to Babylon, and four years later began his religious reforms, banning the worship of all gods other than Yehwa, several of which Zephaniah mentioned as being worshiped in Jerusalem in his writing.
Zephaniah mentioned several gods in his book which were explicitly mentioned in 4ᵗʰ Kingdoms (Masoretic Kings), during King Josiah’s religious reforms. The opening verses denounce the worship of Ba'al, which is treated as a proper name, and therefore is almost certainly a reference to Hadad, the Canaanite storm god, commonly called Ba'al. He then denounced those who worshiped the army of Shamayim, which, based on the Book of Daniel, were the stars, as some copies of Daniel use the phrase “armies of Shamayim,” while other copies use “stars of Shamayim.” Shamayim was the name of the Canaanite god of the “skies,” and the god Jonah identified as the god of his Assyrian owner when he went to prophesy in Nineveh. As all of the geographic references in the Book of Jonah locate his life in Assyrian-occupied Samaria, and later the Assyrian capital of Nineveh, it is likely he was a Samarian slave shortly after the Assyrians had occupied Samaria, as it is recorded that they reduced the entire population to slavery.