Hi,
I can point you to the fact that 2nd of August, 2001 is indeed a Thursday.
(Hint.. Hint !!)
cheers,
Gokul
PS: This question is a general java question and it would be more
appropriate to post this to a general java forum/list.
----- Original Message -----
From: "Dharmendra Yadav" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 9:55 AM
Subject: [SERVLET-INTEREST] Calender Class trouble ...
> hi guys,
> I'm getting a bit of trouble while writing a date related servlet.
> This is a Date routine to calculate some forward date on the basis on
> Day , week , month , year
>
> code look some what like this
>
> Calendar gc = new GregorianCalendar().getInstance();
> gc.clear();
> gc.set(gc.YEAR, 2001);
> gc.set(gc.MONTH, 7);
> gc.set(gc.DAY_OF_MONTH, 2);
>
> System.out.println(gc.get(gc.DAY_OF_WEEK));
> System.out.println(gc.get(gc.DAY_OF_MONTH) +"/"+gc.get(gc.MONTH) + "/"
+
> gc.get(gc.YEAR));
> ......
> ......more code to get forward date
>
>
> I'm setting the date as 2/7/2001 (dd/mm/yyyy format) which is monday
> When I tried to print the current set day of the week , it gives me 5
> Thursday which is Thursday but I expect to be 2 (Monday).
> I do not know what wrong I'm doing.Can anyone explain why this is
happening
> and how to get 2 instead of 5 ?
>
> regards,
> Dharmendra
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html