President Barack Obama and congressional leaders have only hours to avert a midnight Friday government shutdown that they say would inconvenience millions of people and damage a still fragile economy.