Date and Calendar

Hi,

Can anyone clarify the following scenario. I am using a Date class to see the DAY OF WEEK. With Date class it is returning 2 as it is tuesday. I guess it is correct. since Date has been deprecated in JDK1.3.1, I have to use the Calender class instead of Date class. It is returning 3 for DAY OF WEEK. Why is this difference. I am attaching the code for the reference....

System.out.println(calendar.get(Calendar.DAY_OF_WEEK));

Srinivas

[485 byte] By [sreesri] at [2007-9-26 4:37:34]
# 1
Hi,the value returned is correct. The exactly meaning of it is:Calendar.SUNDAY (=1)throughCalendar.SATURDAY (=7)It is better to use this constants then integer values.Best regards,Martin
edosoft at 2007-6-29 17:56:32 > top of Java-index,Archived Forums,Java Programming...
# 2
Hi,Then why is it returning 2 when I am using Date class. Is it like SUNDAY=0 THRU SATURDAY=6 in the Date class. becoz it is returning 2 when I use date class. This is what confusing me..
sreesri at 2007-6-29 17:56:32 > top of Java-index,Archived Forums,Java Programming...