I do not know what is wrong with code below -
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layo
I suggest:
long date = System.currentTimeMillis();
SimpleDateFormat sdf = new SimpleDateFormat("MMM MM dd, yyyy h:mm a");
String dateString = sdf.format(date);
tvDisplayDate.setText(dateString);
which displays in the following example format
Mon Jan 5, 2009 4:55 PM
You can use whatever format you want - options can be found at Oracle