To convert $hour from a 12-hour format into a 24-hour format, which is required by setTime().