Genesis 2:4 (ESV)

4 These are the generations of the heavens and the earth when they were created, in the day that the LORD God made the earth and the heavens.

Again, the Lord talks about the creation of the heavens and the earth. This is done in a different way than in the first chapter. In the previous chapter we were told in general how the earth and everything that lives and grows on it came into being. In Genesis 2:4–25 it is mainly about the creation of man, the creation of man and woman.

Genesis 2:4 is the start of a new section. In the book of Genesis, a new section often begins with the same words: These are the generations of or This is the history of. The other verses in Genesis where the same Hebrew words are used to indicate that a new beginning is about to lead to other things are: Genesis 5:1; Genesis 6:9; Genesis 10:1; Genesis 11:10, Genesis 11:27; Genesis 25:12, Genesis 25:19; Genesis 36:1, Genesis 36:9; and Genesis 37:2. Such new beginnings always point back to the ancestor. Thus, the origin is shown of what follows in the new section.

Immediately after the new beginning (Genesis 1:1 – 2:3) we read here that the Lord is the Creator of everything. Everything that now follows goes back to the Lord who is the Creator. The second part of Genesis 2:4 also indicates what happened during the time that the Lord was creating the earth. So, this is about the six days when God was busy preparing the earth. The translation of in the day indicates a more general use of the word day, like at that time or when (cf. NIV).