Results 1 to 6 of 6
  1. #1
    saran123 is offline Member
    Join Date
    Oct 2008
    Posts
    5
    Rep Power
    0

    Default how to convert date format

    Hi.
    I want a java code to convert the date format from yyyy-mmm-dd to yyyy-mm-dd for the given input date.Please help me.

  2. #2
    pedjacar is offline Member
    Join Date
    Oct 2008
    Posts
    4
    Rep Power
    0

    Default

    Have a look at
    Java Code:
    java.text.SimpleDateFormat
    class (Google search should provide a link to Sun's javadoc).
    Last edited by pedjacar; 10-16-2008 at 11:20 AM. Reason: Added code formatting to class name

  3. #3
    nanaji is offline Member
    Join Date
    May 2008
    Posts
    31
    Rep Power
    0

    Default

    String st = " "; //given input date
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat();

    Date date = sdf.parse(st);

    date.getTime();

    check this

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  5. #5
    whiteknight is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default thanks

    thanks for all

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Simple Date Format
    By arimakidd in forum Java Applets
    Replies: 1
    Last Post: 09-29-2008, 04:46 AM
  2. How to format the date in particular pattern
    By Java Tip in forum java.text
    Replies: 0
    Last Post: 04-04-2008, 02:35 PM
  3. How to format the date in particular pattern
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 09:28 PM
  4. Date format display in CSV file after exporting
    By latha in forum Advanced Java
    Replies: 0
    Last Post: 08-03-2007, 08:09 AM
  5. problems with Date format
    By tommy in forum New To Java
    Replies: 1
    Last Post: 07-25-2007, 08:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •