This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages 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