how to convert mm/dd/yy to dd/mm/yy using collections in
java.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sandya
Thanks Shankar.
can u send more examples on Date.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / zaini
SimpleDateFormat srcDate = new SimpleDateFormat
("MM/dd/yyyy");
SimpleDateFormat destDate = new SimpleDateFormat
("MM/mm/yyyy");
| Is This Answer Correct ? | 1 Yes | 1 No |
Does a class inherit the constructors of its superclass in java programming?
How to set the permissions to a file in java?
What are the allowed, non-Unicode letter characters that can be used as the first character of an identifier?
What is the char data type?
Map map = new HashMap(2); map.add(“1”,”one”); map.add(“2”,”two”); map.add(“3”,”three”); What will happen at this line?
what is difference between front controller and action servlet?
Where import statement is used in a java program?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
please send code example of inner classes?
Can two objects have same hashcode?
What is the default size of arraylist in java?
java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.