We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String d = sc.next();
try {
DateFormat df = new SimpleDateFormat("hh:mm:ssa");
DateFormat out = new SimpleDateFormat("HH:mm:ss");
Date date = df.parse(d);
System.out.println(out.format(date));
} catch (ParseException e) {
e.printStackTrace();
}
sc.close();
}
Time Conversion
You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) { Scanner sc = new Scanner(System.in);