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 the meaning of I ++ in java?
What is the difference between iterator and enumeration ?
What is a classloader in java?
What steps are taken when the OS shifts from one-thread execution to another?
What do you mean by Function Overloading in java?
What is this keyword used for?
Is array a class in java?
What is a treeset in java?
What are the different collection views provided by maps?
Is null a string?
What are the restriction imposed on a static method or a static block of code?
what is difference between equals and ==?
Can we use catch statement for checked exceptions?
Is string a class?
Which is better ascii or unicode?