[Solved] Convert String to Date object [duplicate]


This should work as you specified in your question.

  DateFormat dateFormat = new SimpleDateFormat("yy-MMM-dd HH:mm:ss a");
  System.out.println(dateFormat.format(new Date())); 

The date format you have in your question is something like:

DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHmmss");

2

solved Convert String to Date object [duplicate]