Hi Shashi,

You can use the java.util.Calendar, first you create an instance of
Date then pass it to the Calendar setTime method, after that you can
get the day, month or year. Here is the sample code:


Date date = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(date);

int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);

Regards,
Wayan

-----Original Message-----
From: shashi kanth goud [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 1:27 PM
To: [EMAIL PROTECTED]
Subject: Re: how to get Date,Month... from date


hai all,
       How to get month,date and year from Date object. I have found that
getDate()..... of Date object are deprecated .Is there any other way to get
above things. I will get date from my database
thanx in adv
Shashi



___________________________________________________________________________
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