Original: It was written in 520 BCE some 18 years after Cyrus had conquered Babylon and issued a decree in 538 BCE allowing the captive Jews to return to Judea.
Simplified: It was written in 520 BCE.