DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE MMM dd yyyy HH:mm:ss");
OR
java.text.DateFormat dateFormat = new java.text.SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss");
I have the format of time in data bases tables and I have to convert them into yyyy-MM-dd HH:mm:ss
or MM/dd/YYYY HH:mm:ss
Input : Mon Jan 21 2019 20:06:48 GMT-0400 (EDT)
Expected output : 01/21/2019 20:06:48