Hadrat Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "When Allah created Adam and breathed the soul into him, he sneezed and said: 'Alhamdulillah' (All praise is for Allah). He praised Allah by Allah's permission. Allah Almighty said: 'Yarhamuka rabbuk' (May your Lord have mercy on you). Allah Almighty said: O Adam! Go to that group of angels sitting in a gathering and greet them with salam. He went, and they said: 'Wa 'alaykumus-salamu wa rahmatullahi wa barakatuh' (And upon you be peace, and the mercy of Allah and His blessings).
Then he returned to his Lord. Allah Almighty said: This is your greeting and theirs. And Allah Almighty said, while both His hands were closed: Choose whichever you wish. He said: I choose the right hand of my Lord, and both of my Lord's hands are right and blessed. Then He opened it, and in it were Adam and his offspring. He said: O my Lord! What is this? He said: Your offspring. Each person's lifespan was written between his two eyes.
Among them was one man whose forehead was the brightest, and for his life only forty years were written. He said: O Allah! Increase his life. Allah Almighty said: This is all the life he has. He said: Give him sixty years of my life. Allah Almighty said: That is a matter between you and him. Then he stayed in Paradise as long as Allah willed, then he descended from it. Hadrat Adam kept counting his years. When the angel of death came, Adam said: You have come early; my life is a thousand years. The angel said: Certainly; but you gave sixty years to your son Dawud. So he denied it, and his offspring also deny. Adam forgot, so his offspring also forget. From that day, writing and taking witnesses were commanded."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 20520