Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with DateFormat!?

 
Kriss Masters
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't i compile this code?
SimpleDateFormat dayformat = new SimpleDateFormat("yyyy.MMM.dd");
GregorianCalendar day = new GregorianCalendar();
String now =dagformat.format(day);
/ kriss
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting? Chances are, if you read the error message, you will know what's wrong (javac is usually pretty good at telling you what's wrong....)

If you take a look, you will see that it doesn't know what "dagformat" is. This is correct. The variable that you have is "dayformat"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic