This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GregorianCalendar object

 
Eric Sexton
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a GregorianCalendar object, and a method to get the date:

Now I want to display a String representation of the name of the month. So if I got back a "0", then I want to display 'January'. Obviously, I don't want a huge "if if if" statement. Thanks in advance!
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this

-----------------
Sainudheen
 
Mani Ram
Ranch Hand
Posts: 1140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know whether any build-in methods / variable are available to do this, but in case if there aren't any, you can try this way.
 
Eric Sexton
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. That will work for me. Thanks.
 
Jason Menard
Sheriff
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from the (in this case preferable) method of using an array as shown above, here's another way that will work, using java.text.SimpleDateFormat:

[ September 30, 2003: Message edited by: Jason Menard ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic