BACKGROUND
1. Technical Field
The present disclosure relates to electronic devices, and particularly, to an electronic device with a time update function and a method thereof.
2. Description of Related Art
The system time of electronic devices, for example, mobile phones, may become inconsistent with a standard time due to internal and external factors, for example, temperature. The electronic devices often cannot automatically adjust their system time, and this lack of adjustment function needs to be filled.
BRIEF DESCRIPTION OF THE DRAWINGS
Many aspects of the present disclosure should be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
FIG. 1 is a block diagram of an electronic device in accordance with an exemplary embodiment.
FIG. 2 is a flowchart of a time update method in accordance with an exemplary embodiment.
DETAILED DESCRIPTION
Embodiments of the present disclosure will now be described in detail, with reference to the accompanying drawings.
Referring to FIG. 1, an electronic device 1 with a time update function includes a radio module 10, a clock module 20, a processing module 30, a storage module 40, and an audio input port 50. The radio module 10 receives signals broadcast from a broadcasting station (not shown) and outputs the received broadcast signals as audible sound (audio signals). The audio signals generated by the radio module 10 can be input to the electronic device 1 through the audio input port 50. In this embodiment, the broadcast signals from the station may include current time information which is audible, such as in form of beeps, and the signals of a certain type and frequency which contain the current time information (frequency information) is different from that of audio signals containing no current time information and can be recognized by the processing module 30. The clock module 20 provides a source of real time for the electronic device 1. The clock module 20 may be a real time clock (RTC) oscillator. The storage module 40 stores an initial time. The processing module 30 determines the system time according to the real time provided by the clock module 20 and the stored initial time. The processing module 30 determines whether the audio signals received by the audio input port 50 include current time information according to the frequency information of the audio signals. If the current time information is included, the processing module 30 determines whether the system time of the electronic device 1 is consistent with the current time information received from the broadcasting station, and, if it is inconsistent, replaces the initial time and stores the current time information in its place to adjust the system time. In this embodiment, the processing module 30 can automatically turn on or turn off the radio module 10. In particular, the processing module 30 may automatically turn on the radio module 10 for a predetermined time when the system time is proximate to the hour changing, for example proximate to 9:00 am or pm.
FIG. 2 is a flowchart of a time update method in accordance with an exemplary embodiment.
In step S200, the processing module 30 determines the system time according to the stored initial time and the source of real time in the electronic device.
In step S201, the processing module 30 determines whether the audio signals received by the audio input port 50 include the current time information. If they do, the procedure goes to step S202, otherwise the processing module 30 repeats step S201.
In step S202, the processing module 30 determines whether the system time is consistent with the current time information received. If yes, the procedure returns to step S201, otherwise the procedure goes to step S203.
In step S203, the processing module 30 replaces the initial time with the current time information received, to adjust the system time.
It is believed that the present embodiments and their advantages will be understood from the foregoing description, and it will be apparent that various changes may be made thereto without departing from the spirit and scope of the disclosure or sacrificing all of its material advantages, the examples hereinbefore described merely being exemplary embodiments of the present disclosure.