added the time structure and support to switch to the alarm mode

(1)Replace the time related variable to time structure.
(2)Support switching the mode to the alarm mode, but not implement the detail yet.