1Calendar c = Calendar.getInstance();
2SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
3String strDate = sdf.format(c.getTime());
4Log.d("Date","DATE : " + strDate)
1String currentDateTimeString = java.text.DateFormat.getDateTimeInstance().format(new Date());
2
3// textView is the TextView view that should display it
4textView.setText(currentDateTimeString);
1 SimpleDateFormat sdf = new SimpleDateFormat("ddMMyyyy_HHmmss", Locale.getDefault());
2 String currentDateandTime = sdf.format(new Date());
3 System.out.println("currentDateandTime" + currentDateandTime);