StringDate to Date coming in different Time in SimpleDateFormat in java
问题 /*I want the same Date of my String has Tried with couple of options but nothing worked pasting some of code here */ public void stringToDate() { //Current format "13-FEB-20 03.21.08.100000000 PM" in Melbourne Timezone //Required Format yyyy-dd-MM HH:mm:ss.SSS in Melbourne Timezone String inputAM = "13-FEB-20 03.21.08.100000000 PM"; try { DateFormat df1 = new SimpleDateFormat("dd-MMM-yy hh.mm.ss.S aa"); Date d1 = df1.parse(inputAM); System.out.println("Date-1: " + d1); //Fri Feb 14 19:07:48