Formatting the time into a 12- or 24-hour clock