A Tale Of Time City by Diana Wynne Jones

A child evacuated from wartime London is brought to a hidden metropolis that exists outside ordinary history, where historians monitor and manage the past; when parts of history begin to vanish and sabotage threatens the City's delicate mechanisms, the newcomer and a small group of allies uncover conspiracies, travel through different eras, and race to repair the damaged strands of time before the timeline collapses.

Purchase from Bookshop.org