“In the beginning” is a mistranslation. A grammatically correct translation of the first verse is:
When God first created the heavens and the earth.…
But mine is not unique. A host of Hebrew scholars acknowledge this mistranslation and, like me, offer their version of Gen 1:1 correctly translated. For example, Robert Alter begins this way:
When God began to create the heaven and the earth…
I disagree with Alter grammatically (ever so slightly) since there is no infinitive verb in the text. But this is a translation afterall and the presence of the infinitive is perfectly fine as it does no damage to the meaning of the text.
Next, is Richard Elliott Friedmann’s translation. He gets around the “In the beginning” problem this way:
In the beginning of God’s creating the skies and the earth…
Written this way, the phrase “In the beginning of God’s” is a perfectly good synonym for ‘when’.
Nahum Sarna’s version follows Alter’s. He writes,
When God began to create …
Just as an aside, I prefer my translation because the Hebrew word רֵאשִׁ֖ית (reisheet - the first word in the verse) has a rather wide semantic range, but generally means “head of” or “first”, etc. It derives from the Hebrew word for head. My translation seeks to preserve the idea that this was when …God first began…
So, you can help your atheist interlocutors understand that they’ve got it wrong and to go back to the drawing board.
Insofar as time is concerned, Genesis 1:5 reveals that time is not in view. Specifically, God names the light and the dark as day and night. The author carefully points out that durations of time that follow each other are not in view as God separates the light and the dark spatially. In this account light and dark exist side-by-side once created (much like the light and dark edges of a shadow).
The whole point of the first creation story is to be time-independent. The seven ‘days’ should be seen, not a intervals of time, but as events. We do this naturally, by the way, and looking at Genesis this way should not seem foreign to you. You should consider the ‘days’ of creation to be analogous to the innings of a baseball game, not the quarters of a football game. Innings, unlike quarters, are not limited by time but by whether the batting team makes three outs.