Alternatively, check the wiring loom for possible shorts.
The clock should be on a permanent live as standard on the factory loom - there's only two wires running to it. The dash clock in the BBB started playing silly devils occasionally in the run up to the wiring loom catching fire.
If the clock is resetting itself every time you turn the ignition off, I'd ne wondering if somebody has been messing with the loom, or something is rubbing through the insulation and shorting it out.