1 2 3 4 5 6 7 8
| String str="Jul 24, 2019 3:00:46 PM"; SimpleDateFormat format=new SimpleDateFormat("MMM dd, yyyy hh:mm:ss aa", Locale.ENGLISH); try { System.out.println(format.format(new Date())); System.out.println(format.format(format.parse(str))); } catch (Exception e) { e.printStackTrace(); }
|