Change clock to 12-hour clock and manage time wrapping