U.T.I. dementia lasts as long as the U.T.I., about 24 hours to several weeks.