-2
Date praseDate = formatter_date.parse(this.txtSetRoundDate
                        .getText().toString());

                final Calendar c = Calendar.getInstance();
                c.getTime();
                formatter_date.format(c.getTime());

                Date date = formatter_date.parse(this.txtSetRoundDate.getText().toString());
Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28
Peter Phyo
  • 9
  • 1
  • 3

2 Answers2

0

[I did not have enough points to comment, I just want to help.As the question is not clear so same as answer ].

I think you are asking format of the Android System. If so, thier are many ways of doing it:

One of the i like is:

final String format = Settings.System.getString(getContentResolver(), Settings.System.DATE_FORMAT);
if (TextUtils.isEmpty(format)) {
  dateFormat = android.text.format.DateFormat.getMediumDateFormat(getApplicationContext());
} else {
  dateFormat = new SimpleDateFormat(format);
}

Also, their are another ways like,

Format dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());
String pattern = ((SimpleDateFormat) dateFormat).toLocalizedPattern();
Akhil
  • 829
  • 1
  • 11
  • 26
user3278897
  • 984
  • 10
  • 23
0
public static String getCurrentDate() {
    try {

        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss");
        String currentTimeStamp = dateFormat.format(new Date()); // Find
                                                                    // todays
                                                                    // date
        Log.e("currentTimeStamp", currentTimeStamp);
        return currentTimeStamp;
    } catch (Exception e) {
        e.printStackTrace();

        return null;
    }
}


String Current_Date=getCurrentDate();
Akhil
  • 158
  • 5