Bacterial and viral illnesses last different lengths depending on the pathogen and other variables. Antibiotics shorten bacterial illnesses. Rest, water, and supportive care can treat viral infections for a few days to weeks.