how to convert mm/dd/yy to dd/mm/yy using collections in
java.

Answer Posted / sankar

Hi, Here is the Program


import java.util.Date;
import java.text.SimpleDateFormat;


class DateConversion{

public static void main(String ar[])throws Exception
{

String strDate = "06/12/2008";

SimpleDateFormat srcDate = new SimpleDateFormat
("mm/dd/yyyy");
SimpleDateFormat destDate = new SimpleDateFormat
("dd/mm/yyyy");

System.out.println(destDate.format
(srcDate.parse(strDate)));

}
}

Is This Answer Correct ?    19 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is method in java ?

859


In java how do we copy objects?

795


Does sprintf add a null terminator?

849


What are the benefits of operations in java?

698


What are the main concepts of oops in java?

1150


What language is pass by reference?

799


What is a instance variable in java?

808


What is the difference between conversation & casting?

812


how to open and edit XML file in Weblogic???

1793


What do you mean by Hash Map and Hash Table?

827


What is exception hierarchy in java?

799


Write a program to reverse a number in java?

813


What are local variables?

826


What is compareto () in java?

735


Why we use set in java?

790