Parse a Time with "hh.mm.ss a" format in Java
Description
The following code shows how to parse a Time with "hh.mm.ss a" format.
Example
//from ww w.ja va 2 s .com
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] argv) throws Exception {
DateFormat formatter = new SimpleDateFormat("hh.mm.ss a");
Date date = (Date) formatter.parse("02.47.44 PM");
System.out.println(date);
}
}
The code above generates the following result.