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

Discussion in 'Java' started by BoBi, Dec 13, 2006.

  1. BoBi

    BoBi Guest

    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-belgium/liste_5_fr/une_fete_d'anniversaire_kenyanne_et_une_fete_d'anniversaire_belge.html
    s
    Should I use another class in stead of Date? If yes, which one?

    Best regards,

    BoBi
    BoBi, Dec 13, 2006
    #1
    1. Advertising

  2. 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.
    Andrew Thompson, Dec 13, 2006
    #2
    1. Advertising

  3. BoBi

    vahan Guest

    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
    vahan, Dec 13, 2006
    #3
  4. BoBi

    BoBi Guest

    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
    BoBi, Dec 15, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mgalaty
    Replies:
    0
    Views:
    2,720
    mgalaty
    Sep 10, 2004
  2. Replies:
    1
    Views:
    4,029
    Bjorn Abelli
    Apr 16, 2006
  3. Replies:
    5
    Views:
    98,583
    vongeuca
    May 4, 2011
  4. Marcus
    Replies:
    32
    Views:
    910
    Marcus
    Nov 5, 2005
  5. Replies:
    5
    Views:
    5,595
Loading...

Share This Page