Some digital clocks have small battery backups that keep the time even when they are unplugged, though this only works for a short duration.
Particularly sophisticated clocks are able to connect either to the internet or to a special radio signal maintained by the government ([Here](https://en.wikipedia.org/wiki/WWVB) is the one for the US). This lets them quicky find out the current time no matter how long they have been unplugged.
Latest Answers