from the Bhavishyottara Purana
When: the waxing moon in the month of July/August
The glories of Pavitra Ekadasi is described in Bhavishyottara Purana in the conversation between Lord Krishna and Maharaj Yudhisthira.
Once Maharaj Yudhisthira said to Krishna "O Madhusudana, killer of Madhu demon, what is the name and glories of the Ekadasi which occurs during the waxing moon in the month of July/August. Please explain it to me in detail."
Lord Krishna replied, "O King! The name of this sacred Ekadasi is Pavitra Ekadasi. Now please hear attentively the topics of this Ekadasi which destroys ones sinful reaction. By hearing the glories of this Ekadasi one obtains the result of the Bajapeya sacrifice.
In an ancient time at the beginning of Dvapara Yuga there was a King named Mahijit who ruled the kingdom named Mahismatipuri. But since the king had no sons he did not feel any happiness in conducting his activities. A married man who has no son does not get any happiness either in this life or in the next. The King spent many years in trying to get a son, but he was not fortunate enough to get a jewel like son who would give him all pleasure.
Realising his own pathetic condition one day the king called his subjects, whom he treated as his children, to the royal assembly and said to them, 'O dear subjects I have never committed any sinful activity in this life, I did not increase my treasury by unlawfully earned wealth, I did not plunder the wealth of the brahmins and the demigods, rather I have conquered this world by following the proper code of conduct, I have maintained all of you like my own children, I have never hesitated to award due punishment even to my dear ones like my brother and relatives according to their faults and I have showed due respect to even my enemy if he was gentle and pious. O brahmanas, in spite of travelling on the religious path like this why I am bereft of a son? Please consider carefully the reason behind this and advise me.'
After hearing these lamenting words of King Mahijit the king's brahmana advisers discussed the subject matter amongst themselves and decided that for the benefit of the king they would go to the forest and visit the ashrams of the great sages who know past, present and future. They entered the forest and while wandering here and there they came across the various ashrams of great sages. Finally they met Lomasa Muni who was engaged in severe austerities, whose body was spiritual and full of bliss, who strictly observe the vow of fasting, who was self controlled, who knew the science of Eternal Religious Principals, who was well conversant with the knowledge of all the scriptures, whose duration of life was as long as that of Brahma and who was an effulgent saint. When a kalpa of Brahma passes one hair (loma) of his body falls out and that is why this great sage is known as Lomasa. The sage Lomasa was the knower of past, present and future.
Enchanted by this great sage, the advisers of the king offered their obeisances to him and spoke with humility. 'O great sage! Due to our great fortune we have met a great soul like you.' The sage Lomasa inquired 'who are you all? Why have you come here? Why are you praising me like this?' The brahmins replied 'O great sage! We have come to you for removing some of our doubts. O Lord! Our king Mahijit has no son. We are his subjects and we are treated by the king as his own children. We are feeling distressed on seeing the distress of the King. O best of the Brahmanas, we want to strictly undergo austerity here. It is the good fortune of the king that today we meet a great personality like you. By the darshan of a great personality a man certainly attains all perfections. Please instruct us in such a way that our sonless king can have a son.'
After hearing their sincere prayers the sage Lomasa entered into a deep meditation for a moment and immediately understood the king Mahijit's previous life. He then said 'In his previous life this king was a poor Vaisya (merchant) and he committed a sinful deed. Once while travelling from village to village in the course of his business he became overwhelmed with thirst. It was the midday of dvadasi in the month of July. Soon he found a beautiful lake and decided to drink its water. At that time a cow and her newly born calf came there to drink water. As the cow began to drink water from the lake the merchant immediately drove her away and began to drink water himself . As a result of obstructing an unsatisfied thirsty cow from drinking water the merchant had committed a sin. For this reason, although the merchant by the influence of his piety has now been born as King Mahijit, he has got no son.'
On hearing these words of the great sage the king's advisers said, 'O great sage! It is stated in the Puranas that by the influence of piety all ones sinful reactions are counter acted. Therefore please instruct us in such a way that all the sinful reactions of the king may be destroyed and he can obtain a son.'
The great sage Lomasa replied, 'There is a famous auspicious Ekadasi known as Pavitra Ekadasi which occurs during the waxing moon in the month of July/August. You and your King should properly observe this Ekadasi. Thereafter you should give away your piety that you will earn by observing this Ekadasi. If you follow my instruction then the King will certainly be blessed with a son. After hearing these words from sage Lomasa all the kings advisers became happy and satisfied. They offered their obeisances to the sage and returned home. Then they meet king Mahijit and explained to him in detail what they had heard from the great sage Lomasa.
Thereafter, when the proper time arrived, the kings advisers remembered the advice of the sage and properly observed the vow of Pavitra Ekadasi along with the king. On the day of Dvadasi they gave away their accumulated piety to the king as advised by the sage. By the influence of this piety the queen became pregnant and in due course of time gave birth to a beautiful son.
O King Yudhisthira! Any one who observes this sacred Ekadasi is relieved from sinful reactions and becomes happy both in this life and in the next. One who hears the glories of this Ekadasi obtains the happiness derived from having a son in this life and goes back to godhead in his next life."