I hate to admit this, but I'm having trouble making sense of basic date formatting. I know that I am simply over-thinking this, but the documentation that I am seeing is just missing me completely. What I am trying to do is simply display the current date formatted as "Wednesday, February 20, 2013" for example. What I have so far is:
TextView textView = (TextView) findViewById(R.id.currentDate);
String now = DateFormat.getDateInstance().format(new Date());
textView.setText(now);
This produces something like "2013-2-20", which is a great first step, but not what I want. In looking through the documentation I am confused because the DateFormat
docs all say to use an integer to signify SHORT
, MEDIUM
, LONG
, or DEFAULT
. What? Where, exactly, would I put this argument? And how / which integer signifies SHORT
vs LONG
? None of this makes sense and I feel like a complete moron because I know it is very obvious. I'm coming at this from years of using PHP's date formatting and I am sure that my old habits are completely blocking me from seeing the simplicity of this.