![]() |
warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
Dear Java Programmers,
When compiling my Java program I get the following warning: "warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated" on for example this statement: new Date("09/23/2003") The code is used to generate the dates on a webpage. Depending on the language of the webpage the generated format is different. For example English (see "Date" and "Choose publication" on the page opened): http://home.scarlet.be/kenya-belgium...day_party.html French: http://home.scarlet.be/kenya-belgium/liste_5_fr/une_fete_d'anniversaire_kenyanne_et_une_fete_d'ann iversaire_belge.html s Should I use another class in stead of Date? If yes, which one? Best regards, BoBi |
Re: warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
BoBi wrote:
... > "warning: [deprecation] in java.util.Date(java.lang.String) has been > deprecated" ..... > Should I use another class in stead of Date? Yes. >..If yes, which one? Mentioned in the JavaDocs* for the constructor(s) of Date. <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#constructor_summary> (* you should bookmark them, and consult them regularly..) Andrew T. |
Re: warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
Andrew Thompson wrote: > BoBi wrote: > .. > > "warning: [deprecation] in java.util.Date(java.lang.String) has been > > deprecated" > .... > > Should I use another class in stead of Date? > > Yes. > > >..If yes, which one? > > Mentioned in the JavaDocs* for the constructor(s) of Date. > <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#constructor_summary> > (* you should bookmark them, and consult them regularly..) > > Andrew T. You can use java.util.Calendar or java.text.SimpleDateFormat depends from your preference |
Re: warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
Hi,
Thanks both of you. I'll be checking your suggestions out for solving my warning. :cą, BoBi vahan schreef: > Andrew Thompson wrote: > > BoBi wrote: > > .. > > > "warning: [deprecation] in java.util.Date(java.lang.String) has been > > > deprecated" > > .... > > > Should I use another class in stead of Date? > > > > Yes. > > > > >..If yes, which one? > > > > Mentioned in the JavaDocs* for the constructor(s) of Date. > > <http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#constructor_summary> > > (* you should bookmark them, and consult them regularly..) > > > > Andrew T. > > You can use java.util.Calendar or java.text.SimpleDateFormat depends > from your preference |
| All times are GMT. The time now is 10:42 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.