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 a locale?
What does %4d mean in java?
Can we define a package statement after the import statement in java?
What is the difference between an object-oriented programming language and object-based programming language?
what is daemon thread and which method is used to create the daemon thread? : Java thread
What is stringwriter?
What is javac_g?
What does || mean in vectors?
What is type safety in java?
What is the difference between superclass and subclass?
What is the difference between access specifiers and access modifiers in java? 16
Difference between default and protected access specifiers?
What do you understand by the bean persistent property?
How hashmap works in java?
Difference between arraylist and vector.