That's because Month is 0 based, so 0=January and 4=May.
    (*Chris*)

----- Original Message -----
From: Seong Y. Kim <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 28, 1999 4:54 PM
Subject: a problem with getting month information from Date object.


> Hi, all.
>
> I am trying to get a month information from date object as following
source
> code.  However, I am getting wrong information.  Can anyone tell me why? I
do
> not have any wrong date information on my system.
>
> ;
> ;
> Date curr_date=new Date();
> System.out.println(curr_date.getMonth());
> ;
> ;
>
> This should give me current month information, but, this gives previous
month
> information.
> This gives me 4, instead of 5.
>
> Thanks for the concern.
>
> yours.
>
>
___________________________________________________________________________
> 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

Reply via email to