Deprecation warning

Posted on 2006-03-27
Last Modified: 2008-02-01
When I compile my code (JDK 1.5.0_06) I receive the following message: warning: [deprecation] toLocaleString in java.util.Date has been deprecated
            string tmpDate = curdate.toLocaleString().trim();

There is an accent under the . after curdate.

Do I need to change API's, if so how, or can I compile and ignore the deprecation messages.

Question by:mauler
    LVL 92

    Expert Comment

    you can ignore the warning.
    LVL 92

    Accepted Solution

    or to get rid of it replace line with:

    String tmpDate = DateFormat.format(curdate)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    VB Script 3 60
    What is the compatible hibernate version for spring 4.3.1 10 49
    endX challenge 2 32
    json example 39 77
    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    This video teaches viewers about errors in exception handling.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now