Calendar cal = Calendar.getInstance();
DatePickerDialog.OnDateSetListener listener = new DatePickerDialog.OnDateSetListener(){
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, monthOfYear);
cal.set(Calendar.DAY_OF_MONTH, dayOfMonth);
}
};
return new DatePickerDialog(this, listener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
И для получения даты в виде строки (пятница, 28/10/2011 15: 59: 00: 0)
SimpleDateFormat sdfDate = new SimpleDateFormat("EEEE, d/M/yyyy HH:mm:ss:S");
String date = sdfTime.format(new Date(cal.getTimeInMillis()));