I am trying to Convert date and time i am receiving in MM/dd/yyyy hh:mm a format to milliseconds so that i can push the date as end date in google calendar. I am trying below code but i am getting error.
Code:
String myDate = "10/20/2017 8:10 AM";
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
Date date = sdf.parse(myDate);
long millis = date.getTime();
Error:
java.text.ParseException: Unparseable date: "10/20/2017 8:10 AM" (at offset 16)