You can also read this Sutta on SuttaFriends.org. Learn all about the practical aspects of following the eight precepts. And here is a story about someone who collected merit even keeping the precepts for half a day.
This is how I heard. At one time the Blessed One was living in the city of Sāvatthī, in Jeta’s garden, at Anāthapiṇḍika’s monastery. There the Blessed One addressed the monks saying, “Monks!” “Bhante,” they replied. The Blessed One said this:
“Monks, the observance of the uposatha with its eight factors is very beneficial, brilliant and expansive. And how should it be observed?
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up killing living beings, giving up the rod and the sword. They are very careful with their behaviour and kind, and live full of compassion for all living beings. I, too, for this day and night will give up killing living beings, giving up the rod and the sword. I’ll be very careful with my behaviour and kind, and live full of compassion for all living beings. I will observe the uposatha by doing as the arahants do in this way.’ This is its first factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up stealing. They take only what’s given, and expect only what’s given. They keep themselves clean by not stealing. I, too, for this day and night will give up stealing. I’ll take only what’s given, and expect only what’s given. I’ll keep myself clean by not stealing. I will observe the uposatha by doing as the arahants do in this way.’ This is its second factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up incelibacy. They are celibate, set apart, avoiding the low practice of sex. I, too, for this day and night will give up incelibacy. I will be celibate, set apart, avoiding the low practice of sex. I will observe the uposatha by doing as the arahants do in this way.’ This is its third factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up lying. They speak the truth and stick to the truth. They’re honest and trustworthy, and don’t trick the world with their words. I, too, for this day and night will give up lying. I’ll speak the truth and stick to the truth. I’ll be honest and trustworthy, and won’t trick the world with my words. I will observe the uposatha by doing as the arahants do in this way.’ This is its fourth factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up intoxicating drinks and drugs . I, too, for this day and night will give up intoxicating drinks and drugs. I will observe the uposatha by doing as the arahants do in this way.’ This is its fifth factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants eat during the morning time before noon , giving up eating at night and from eating food after 12 noon till dawn the next day. I, too, for this day and night will eat during the morning time before noon , giving up eating at night and from eating food after 12 noon till dawn the next day. I will observe the uposatha by doing as the arahants do in this way.’ This is its sixth factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up dancing, singing, music, and seeing shows; and beautifying and decorating themselves with strings of flowers, perfume, and makeup. I, too, for this day and night will give up dancing, singing, music, and seeing shows; and beautifying and decorating myself with strings of flowers, perfume, and makeup. I will observe the uposatha by doing as the arahants do in this way.’ This is its seventh factor.
“It’s when a noble disciple thinks: ‘As long as they live, the arahants give up luxurious and comfortable seats and beds. They sleep in a low place, either a small bed or a straw mat. I, too, for this day and night will give up luxurious and comfortable seats and beds. I’ll sleep in a low place, either a small bed or a straw mat. I will observe the uposatha by doing as the arahants do in this way.’ This is its eighth factor. The observance of the uposatha with its eight factors in this way is very fruitful and beneficial and brilliant and expansive.”
If you liked that sutta, you may enjoy reading AN 10.46 Sakka Sutta where the Supreme Buddha scolds his family members for not keeping the eight precepts often enough. And Vv 3.3 Pallaṅka Sutta is a lesson from a deva who explains how keeping the eight precepts four times a month helped to be reborn in heaven.