Language:
كتاب الصوم
30  
Fasting
(54)
Chapter: The right of the guest in fasting.
(54)
باب حَقِّ الضَّيْفِ فِي الصَّوْمِ
Sahih al-Bukhari 1974

Narrated `Abdullah bin `Amr bin Al-`As:

"Once Allah's Messenger (ﷺ) came to me," and then he narrated the whole narration, i.e. your guest has a right on you, and your wife has a right on you. I then asked about the fasting of David. The Prophet (ﷺ) replied, "Half of the year," (i.e. he used to fast on every alternate day).

حَدَّثَنَا إِسْحَاقُ، أَخْبَرَنَا هَارُونُ بْنُ إِسْمَاعِيلَ، حَدَّثَنَا عَلِيٌّ، حَدَّثَنَا يَحْيَى، قَالَ حَدَّثَنِي أَبُو سَلَمَةَ، قَالَ حَدَّثَنِي عَبْدُ اللَّهِ بْنُ عَمْرِو بْنِ الْعَاصِ ـ رضى الله عنهما ـ قَالَ دَخَلَ عَلَىَّ رَسُولُ اللَّهِ صلى الله عليه وسلم فَذَكَرَ الْحَدِيثَ يَعْنِي ‏"‏ إِنَّ لِزَوْرِكَ عَلَيْكَ حَقًّا، وَإِنَّ لِزَوْجِكَ عَلَيْكَ حَقًّا ‏"‏‏.‏ فَقُلْتُ وَمَا صَوْمُ دَاوُدَ قَالَ ‏"‏ نِصْفُ الدَّهْرِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1974
In-book reference : Book 30, Hadith 81
USC-MSA web (English) reference : Vol. 3, Book 31, Hadith 195
  (deprecated numbering scheme)