Since the java.util.Date object stores Date as 2014-01-24 17:33:47.214, but I want the Date format as 2014-01-24 17:33:47. I w
You can use the SimpleDateFormat class to format the date as necessary. Due to the diversity of possible combinations, I will simply include the documentation link here:
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Your code will look something similar to the following:
System.out.println(new SimpleDateFormat("MM/dd/yyyy").format(date));