How to format correctly according to the device configuration date and time when having a year, month, day, hour and minute?
This will do it:
Date date = new Date(); java.text.DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext()); mTimeText.setText("Time: " + dateFormat.format(date));