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
What is method in java ?
In java how do we copy objects?
Does sprintf add a null terminator?
What are the benefits of operations in java?
What are the main concepts of oops in java?
What language is pass by reference?
What is a instance variable in java?
What is the difference between conversation & casting?
how to open and edit XML file in Weblogic???
What do you mean by Hash Map and Hash Table?
What is exception hierarchy in java?
Write a program to reverse a number in java?
What are local variables?
What is compareto () in java?
Why we use set in java?