I want to get the current Date Format of Android emulator. Can anyone help me?
Not like this
SimpleDateFormat FormattedDATE = new SimpleDateFormat("M-d-yyyy");
Calendar cal = Calendar.getInstance();
There are various options:
DateFormat defaultFormat = DateFormat.getDateInstance();
DateFormat longFormat = DateFormat.getDateInstance(DateFormat.LONG);
DateFormat mediumFormat = DateFormat.getDateInstance(DateFormat.MEDIUM);
// etc
And likewise for getDateTimeInstance
.
Basically look at the static methods of DateFormat
that return instances of DateFormat
.
See more on this question at Stackoverflow