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

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -