What makes a digital odometer remember the mileage?

On a related note (since the OP has been answered) computers do have a battery in them that provides enough power to keep the time/date/boot setup data intact whilst it is disconnected from the power.