Allaah says (interpretation of the meaning):
“O you who believe! Observing As-Sawm (the fasting) is prescribed for you as it was prescribed for those before you, that you may become Al-Muttaqoon (the pious)”
This verse indicates that fasting is an ancient act of worship that was enjoined upon those who came before us just as it is enjoined upon us. But were they asked to fast in Ramadaan or at other times? I do not know of any statement of the Prophet (peace and blessings of Allaah be upon him) concerning that. End quote.