Avatar,
The Date constructor which you suggested is DEPRECATED.
you can simply use
java.util.Date today = new java.util.Date();
Thanks
Kishore Raghavan
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of AVATAR SINGH
Sent: Thursday, April 27, 2000 1:42 PM
To: [EMAIL PROTECTED]
Subject: Re: DATE IN JAVA
One of the many Ways:
Calendar cal = Calendar.getInstance();
int yr= (cal.get(Calendar.YEAR)-1900);
int mnth=cal.get(Calendar.MONTH);
int de=cal.get(Calendar.DAY_OF_MONTH);
java.sql.Date dateToday = new java.sql.Date(yr,mnth,de);
Munish Talwar wrote:
> Hi,
>
> Can anybody tell me how can I find today's date in Java.
>
> In Oracle or Microsoft
>
> we use sysdate, or now to do this but in java what do we have for this
>
> Thanks
> Munish
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets