Hello I want to display current date. I trying do it like this:
calendar c = Calendar.getInstance();
System.out.println("Current time => "+c.getTime());
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = df.format(c.getTime());
TextView txtView = (TextView)findViewById(R.id.tvDate);
txtView.setText("Current Date and Time : "+formattedDate);
But it don’t display the date in my textView.
Is there a better way to display the same date? I want like this: Monday, April 22
You should look at the documentation for
SimpleDateFormat.SimpleDateFormat
should be