The first one was written during the time when Israel had kings ruling Jerusalem and before their deportation to Babylon in 587 BC. The customary scholarly description for the earlier custom, which extends sporadically all through the Pentateuch, is the Yahwist or J tradition. Many scholars would date the later creation story in Genesis 1:1 2:3 to a time after 587BC and the exile to Babylon. It is also argued that it may have been written even later i.e. after the return to Judah in 539BC during the Persian period. This tradition is called as the priestly tradition or the P tradition. There are lots of difference between the Y tradition and the P tradition (Shelley)
The two chapters of Genesis fulfil every aspect of a Myth, or a kind of Myth conclusion. There are two accounts of creation in the genesis and they surely contradict each other. It is absolutely old and deals with a paranormal being that a society found vital.
Therefore the first two chapters are an atheist's best friend and a Christian's nightmare. It is a blatant contradiction in what is claimed to be a divinely inspired document. In the first God created mankind on the sixth day. After making everything else, finally he creates mankind. Then he rests. In the subsequent creation the timeline is not broken up into days. But the first thing God does is to make Man before he makes even plants.