A time-information obtaining apparatus comprising: a receiving unit for receiving a standard-time radio wave to obtain and output a time signal, which includes a time code comprising plural bits; an input waveform data pattern generating unit (21, 24) for sampling the time signal output from the receiving unit to generate an input waveform data pattern; an internal time counting unit with a built-in clock signal generator, for counting a base time based on a clock signal; a calculation-waveform data pattern generating unit for generating plural calculation-waveform data patterns having the same time length as the input waveform data pattern, based on the base time counted by the internal time counting unit; an error detecting unit for comparing sample values of the input waveform data pattern with sample values of the plural calculation-waveform data patterns to detect discrepancies between the input waveform data pattern and the calculation-waveform data patterns, thereby obtaining a number of errors between the input waveform data pattern and each of the plural calculation-waveform data patterns, wherein the number of errors represents a number of discrepancies; and a present-time correcting unit (11, 26) for correcting the base time based on the calculation-waveform data pattern having a smallest number of errors, characterized in that the error detecting unit comprises: an invalid-bit detecting unit for detecting, among the plural calculation-waveform data patterns, invalid bits having sample values not to be compared with the input waveform data pattern; and an error counting unit for comparing the sample values of valid bits of the plural calculation-waveform data patterns having the invalid bits removed with the sample values of the corresponding bits of the input waveform data pattern to detect the discrepancies. a receiving unit for receiving a standard-time radio wave to obtain and output a time signal, which includes a time code comprising plural bits; an input waveform data pattern generating unit (21, 24) for sampling the time signal output from the receiving unit to generate an input waveform data pattern; an internal time counting unit with a built-in clock signal generator, for counting a base time based on a clock signal; a calculation-waveform data pattern generating unit for generating plural calculation-waveform data patterns having the same time length as the input waveform data pattern, based on the base time counted by the internal time counting unit; an error detecting unit for comparing sample values of the input waveform data pattern with sample values of the plural calculation-waveform data patterns to detect discrepancies between the input waveform data pattern and the calculation-waveform data patterns, thereby obtaining a number of errors between the input waveform data pattern and each of the plural calculation-waveform data patterns, wherein the number of errors represents a number of discrepancies; and a present-time correcting unit (11, 26) for correcting the base time based on the calculation-waveform data pattern having a smallest number of errors, characterized in that the error detecting unit comprises: an invalid-bit detecting unit for detecting, among the plural calculation-waveform data patterns, invalid bits having sample values not to be compared with the input waveform data pattern; and an error counting unit for comparing the sample values of valid bits of the plural calculation-waveform data patterns having the invalid bits removed with the sample values of the corresponding bits of the input waveform data pattern to detect the discrepancies.