This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem regarding Date class

 
Chintan Shah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..guys,
I am developing one website..and i am using Date class in JSP.
The date class returns 1 for Monday, 2 for Tuesday.
Now what i want is that i need to reconvert 1 to Monday, 2 to Tuesday because..i need to compare all of them..and then show appropriately Monday, Tuesday on customers page. Please let me know..how to compare..and how to show week days.
any help is appreciated . thanx in advance.
Chintan shah
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Date.getDay() is a deprecated method. You should use the java.util.Calendar.

check this API out:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html#SUNDAY

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64607
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not much to do with JSP, so this has been moved to Java in General (beginner).
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a solution involving


Sorry, last (first?) probable post today - close of day in my timezone zzzzz.....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic