Bismi Allah Ar Rahman Ar Rahim.
In the name of God, the Most Gracious, the Most Merciful.
All Perfect Praise be to Almighty God,
and prayers and peace be upon the Messenger of Allah and his family and companions,
Having said that,
Peace be upon those who follow guidance
God Almighty said :
("and eat and drink until the white streak becomes manifest to you from the dark streak at the crack of dawn. Then complete the fast until nightfall, ")(Surat Al-Baqarah:187)
In this verse of The Quran; Allah clearly state the permitted time to eat during night and when to begin fasting ("crack of dawn") until ("nightfall") which refers to the sunset, therefore there is nothing such as 24 hours fasting, then we can summarize that fasting period is during daytime ( from dawn (fajr) to sunset (maghrib)).
Now for the fasting of The Prophet Dawood (David) - Blessing of Allah upon him - Prophet Mohammad - Prayers and Blessings of Allah upon him - told us that he was fasting one day (dawn to sunset) and not fasting the next day (regular eating and drinking), for example - fasting (dawn to sunset) on these days : Saturday - Monday - Wednesday - Friday - Sunday - Tuesday - Thursday - ... and it goes like this one day fasting and the next day regularly eating and drinking (Just keep in mind that there is no night fasting)
Also, Fasting is forbidden on these days:
1- Eid al-Fitr (1st Shawwal) in the Hijri (Islamic calendar).
2- Tashriq (11th, 12th, 13th Dhulhijjah) in the Hijri (Islamic calendar).
3- Eid Al Adha (10th of Dhu al-Hijjah in the Hijri (Islamic calendar)).
Also, Fasting everyday is forbidden too.
I hope that this is helpful and clarifies any misunderstanding, Ill be glad to explain more about it if youve got any other followup points
and God knows best.