A gastrointestinal virus usually lasts 1 to 3 days but can be up to a week. I have noticed that since having my colon removed, it takes longer for my system to "normalize" again after having such an illness, so sometimes I might feel off for about 1-2 weeks. Given that you are still very close out from your surgery, though, I would keep a closer eye on things. Going to the hospital sucks (believe me, I've ridden out partial obstructions at home because I loathe the ER so much) but if you're not seeing an improvement within 24 hours, or if you stop passing stool and/or develop the wave-like cramping that I described earlier, it's time to head to the hospital.
PS - I have had a number of partial obstructions, and sometimes yes, at the beginning I don't always know if it's a virus or a blockage. But almost invariably for me, the telltale sign of obstruction is always the wave-like cramping. If I'm dealing with a virus, I never have cramping of that nature. I may have mild, generalized abdominal discomfort but it's nothing like the type of cramping I have with an obstruction.