A detection unit positioned on a package includes a magnet, a first magnetic switch, a second magnetic switch, a processor, and a clock. The first magnetic switch outputs a first control signal or a second control signal according to magnetic flux density of the magnet. The second magnetic switch outputs a third control signal or a fourth control signal according to the magnetic flux density of the magnet. The first control signal is the same as the third control signal; the second control signal is the same as the fourth control signal. When the processor receives the first control signal and the third control signal at the same time, the processor reads a first real-time clock (RTC) signal from the clock. When the processor receives the second control signal and the fourth control signal at the same time, the processor reads a second RTC signal from the clock.