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\'.<
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateFormatter {
/**
* @param args
*/
public static void main(String[] args) {
Date date = new Date("14-Dec-2010"); //deprecated. change it to your needs
DateFormat df = new SimpleDateFormat("dd-MM-yyyy");
System.out.println(df.format(date));
}
}