When you have viral diarrhea most people who have viral diarrhea are usually over the viral diarrhea within a couple days.
Although in some cases of more severe viral diarrhea the diarrhea may last as long as 7 to 10 days.
Whenever I've experienced viral diarrhea it went away within 3 days at most and if it lasts longer than that you might want to see your doctor about it or go to urgent care.
Having viral diarrhea is different than regular diarrhea that sometimes happens to people since viral diarrhea is caused by bacteria, such as Clostridium difficile, salmonella and E. coli, or parasites, such as giardia.
So if the diarrhea lasts longer than a few days or so then an urgent care or doctors visit would be a good idea as the doctor may be able to get you on some antibiotics or other medicine that can kill the bacteria causing the viral diarrhea.
You can also try taking some anti diarrhea medicine that you can get over the counter which can sometimes help slow down or stop the diarrhea.