Allah said, having made His Hands closed: “Select any one of them.” Adam said: “I select the right hand and both the hands of my Lord are right and blessed.” Then Allah spread it. There was Adam and his generation. Adam asked: “O Lord! Who are these people?” Allah said: “They are your children.” Every human being’s life is written between his eyes. Among them was a man with the brightest face. For him was written only forty years of age. Adam said: “O Lord! Who is this fellow?” Allah said:
“This is your son Dawood [David]. His life span is written forty years.” Adam said: “O Lord! Increase his age.” Allah said: “This is what I have written down for him.” He said:
“Then I give him sixty years of my age.” Allah said: “This is between you and him. Live in Paradise.”
He lived there as long as Allah wished. Then he was descended from it to earth. Adam was counting his age. Then the angel of death came to him. Adam said to him: “You have come earlier. For me, one thousand years have been written.” The angel said:
“Yes, but out of them you have given sixty years to your son Dawood.” Adam denied that so his successors also denied. He forgot, so his successors also forgot. From that day, Allah ordered writing down and making witnesses (for pledges).
This hadith is sound and reported by Ibn Abi Asim, Ibn Hibbaan and Hakim in his
mustadrak.
This link provides interesting debate over the hadith quoted by Br Ahmed H
http://www.ahlalhdeeth.com/vbe/showthread.php?p=99899