A Rubidium frequency reference generates a 10MHz signal which is divided down by a decade counter chain and fed through a rotary switch to a BNC port. This is the frequency generator. Meanwhile, the 1Hz output from the counter is fed to a PIC microcontroller which uses it to count seconds and display the day and time. A couple of buttons and a switch allows the time to be set. It's possible to manually set the time accurately to within a fraction of a second, and after that, it won't gain or lose even a millisecond in my lifetime. Theoretically.