I got date as \'14-Dec-2010\' i want to get the month in number format for the given date. that is., i want to convert the date to \'14-12-2010\'.<
\'14-Dec-2010\'
\'14-12-2010\'
DateFormat format = new SimpleDateFormat("dd-MMM-yyyy"); Date date= format.parse("14-Dec-2010");
This is how you will get Date Object now you can print it in any format. Note: month starts from 0 , so for Dec it would be 11
Dec
11