Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated (http://www.velocityreviews.com/forums/t389387-warning-deprecation-in-java-util-date-java-lang-string-has-been-deprecated.html)

BoBi 12-13-2006 05:19 AM

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


Andrew Thompson 12-13-2006 05:53 AM

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.


vahan 12-13-2006 06:32 AM

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


BoBi 12-15-2006 04:51 AM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57