Actually, on thinking about it some more, that is wrong!
You do not need to be in the UK at all, on the day the application reaches the Home Office.
You need to have been in the UK on a day precisely five years before the application reaches the Home Office. That is where the timing is important.
An example: some years ago, a friend of mine decided to apply, after having lived in the UK for well over five years - I think it was closer to fifteen. She submitted her application, and it was refused because, five years earlier, her father had died and she had returned to Australia for a few days, for the funeral. So she wasn't in the UK on the day the "countdown" started for her application, five years before the application went in.... So they refused her.
paul