you should try to use the Date(long) constructor. It takes in the
milliseconds from January 1st, 1970.
You can use System.currentTimeMillis() to get the current time in
milliseconds.
As for converting from a specific date to get the milliseconds ... well I
must admit that I haven't really given it much thought!
Hope this helps,
Stefan
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Munish Talwar
Sent: 27. apr�l 2000 21:31
To: [EMAIL PROTECTED]
Subject: Re: DATE IN JAVA
Thanks a lot
I am getting this error on new java.sql.Date(yr,mnth,de);
the constructor invoked to create java.sql.Date with arguments(int,int,int)
is deprecated.
Any ideas??
Thanks
Munish Talwar
-----Original Message-----
From: AVATAR SINGH [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 27, 2000 4: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
===========================================================================
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