warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated

B

BoBi

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-belgiu...thday_party_and_a_belgian_birthday_party.html

French:
http://home.scarlet.be/kenya-belgiu...enyanne_et_une_fete_d'anniversaire_belge.html
s
Should I use another class in stead of Date? If yes, which one?

Best regards,

BoBi
 
V

vahan

Andrew said:
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
 
B

BoBi

Hi,

Thanks both of you. I'll be checking your suggestions out for solving
my warning.

:cà, BoBi

vahan schreef:
Andrew said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top