I have a datepicker. My app is pushing a notification. I want to display the date in 01-07-2013 MM-dd-yyyy format. Please check my code below:
//---Button v
You can add this code:
Date d = new Date(year, month, day);
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"MM-dd-yyyy hh:mm");
strDate = dateFormatter.format(d);
after
year = calendar.get( Calendar.YEAR );
month = calendar.get( Calendar.MONTH );
day = calendar.get( Calendar.DAY_OF_MONTH );
hour = calendar.get( Calendar.HOUR );
minute = calendar.get( Calendar.MINUTE );
So your strDate will be in format you want (MM-dd-yyyy)