문제

My input is in the format of Sep 22, 2008 and how to convert it into 9/22/2008 using JAVA?

도움이 되었습니까?

해결책

Do like this

   Date date = new SimpleDateFormat("MMM d, yyyy").parse("Sep 22, 2008");
   String formattedDate = new SimpleDateFormat("MM/dd/yyyy").format(date);
   System.out.println(formattedDate);

output

09/22/2008
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top