A given length of an input signal can be detected with small power consumption. A real time clock apparatus has an oscillating module which outputs an original oscillating clock signal having a predetermined frequency, a plurality of dividing modules which divides the original oscillating clock signal outputted from the oscillating module to generate clock signals having a period different from each other, a clock selecting circuit which outputs a clock signal having a given period outputted from the dividing module based on the supplied selection signal, and a signal detecting circuit which is connected to an external switch and which detects a length of an inputted signal by a clock signal outputted from the clock selecting circuit and senses whether the inputted signal is an input signal from the switch.