Android Today's date -


Hello I want to present the current date. I'm trying to do this:

  calendar c = calendar .get instances (); System.out.println ("Current Time = & gt;" + c.getTime ()); SimpleDateFormat df = New Simple Format ("yyyy-MM-dd HH: mm: ss"); String formatteddet = df.format (c.getTime ()); TextView txtView = (TextView) ViewById (R.id.tvDate); TxtView.setText ("Current Date and Time:" + Formatted Data);   

but it does not display dates in my text view.

Is there a better way to display the same date? I like this: Monday, April 22

You SimpleDateFormat .

  Simple Data Format df = New Simple Data Format ("yyyy-MM-dd HH: mm: ss");   

should be

  SimpleDataformat DF = New SimpleDateform ("EEEE, MMMMM DDDD");    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -