What i think is he had help a month before this all happened and then when everyone evacuated they unhooked the hopeless and shut down all machines and ran.
But by then rick had enough water supply to last him at least 5 days.
All the walkers that probably roamed the hallways had dispersed so it has been a few days.
I asked my dad how long he thinks he was and he said a month and a half.