code of TimeMessage based on Android