In the beginning, when God created the heavens and the earth, the earth was a formless wasteland ...
Interestingly, "when" is not in the Hebrew. The Hebrew, according to the Masoretic pointing, reads "In the beginning, God created the heavens and the earth." I did a study on this some years ago, and all the ancient translations--the Greek (LXX), the Latin (V), the Syriac (S), etc.--also read "In the beginning, God created the heavens and the earth."
Nonetheless, the NAB's reading--with the slipped-in "when", which makes v. 1 a temporal clause with v. 2, rather than a separate sentence--is the current "fashionable" approach. That's how the NRSV and the New Jewish Publication Society (NJPS) versions also read. What's the agenda here?
It also raises an interesting question. What does it mean to say, "The text means X," when there's no evidence that anyone understood the text to mean "X" prior to, say, your own generation? Second Temple Judaism, the New Testament authors, the Church Fathers, the Medievals, etc. all read "In the beginning God created ..." What does it mean to now say, that's not the "meaning" of the text? Can the "meaning" really be different than what everyone understood the meaning to be? Whatever one's answer, it's an interesting question.