Write a method that will take in a time in 24 hour format (1430) and return time in 12 hour format (2:30pm)
<p>So, I'm trying to use the SimpleDateFormat to get the user input but I keep getting the error, Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date</p>

<p>Not really sure how I can get the string to take in the information and convert it or if it's possible to do this way. Any comments that could steer me in the right direction would be much appreciated.</p>

<pre><code>import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class takeTime {


    public static void main(String[] args) {


        Scanner reader = new Scanner(System.in);

        System.out.print( "Please enter a time: " );
        String now = reader.nextLine();
        SimpleDateFormat format = new SimpleDateFormat("h:mm a");
        System.out.println( format.format(now));
    }

}
</code></pre>
