How can I change this 24h clock to a 12h clock?
<p>I currently have a 24 hour clock. it displays hours, then minutes. I am trying to change it so that it it displays a 12h version but displays either AM, or PM. For example if you input 17:34. It would display 5:34AM. Here is my code. (I have two classes 'clockDisplay' and 'numberdisplay').</p>

<pre><code>public class ClockDisplay
{

public static final int HOURS_PER_DAY = 24;
public static final int MINUTES_PER_HOUR = 60;

private NumberDisplay hours;
private NumberDisplay minutes;
private String displayString;    // simulates the actual display

/**
 * Constructor for ClockDisplay objects. This constructor 
 * creates a new clock set at 00:00.
 */
public ClockDisplay()
{
    hours = new NumberDisplay(HOURS_PER_DAY);
    minutes = new NumberDisplay(MINUTES_PER_HOUR);
    updateDisplay();
}

/**
 * Constructor for ClockDisplay objects. This constructor
 * creates a new clock set at the time specified by the 
 * parameters.
 * @param hour the hour to set
 * @param minute the minute to set
 */
public ClockDisplay(int hour, int minute)
{
    hours = new NumberDisplay(HOURS_PER_DAY);
    minutes = new NumberDisplay(MINUTES_PER_HOUR);
    setTime(hour, minute);
}

/**
 * This method should get called once every minute - it makes
 * the clock display go one minute forward.
 */
public void timeTick()
{
    minutes.increment();
    if(minutes.getValue() == 0) {  // it just rolled over!
        hours.increment();
    }
    updateDisplay();
}

/**
 * Set the time of the display to the specified hour and
 * minute.
 * @param hour the hour to set
 * @param minute the minute to set
 */
public void setTime(int hour, int minute)
{
    hours.setValue(hour);
    minutes.setValue(minute);
    updateDisplay();
}

/**
 * Return the current time of this display in the format HH:MM.
 * @return current time as a String
 */
public String getTime()
{
    return displayString;
}

/**
 * Update the internal string that represents the display.
 */
private void updateDisplay()
{
    displayString = hours.getDisplayValue() + ":" + 
                    minutes.getDisplayValue();
}
</code></pre>

<p>}</p>
