How long does gastroenteritis remain contagious?

Up to 3 weeks. Rotavirus, the most common cause of gastroenteritis, is shed in the stool for up to 21 days. Obviously most kids are not excluded from daycare that long after an illness, which is why hand hygiene is so important.