2011-03-23에서 Java에서 23-03-2011로 변환하는 가장 간단한 방법은 무엇입니까?날짜 dd-MMM-yyyy를 dd-MM-yyyy로 변환
모두에게 감사드립니다. 이 문제를 해결하는 것 같습니다 :
try {
Calendar cal = Calendar.getInstance();
cal.setTime(new SimpleDateFormat("dd-MMM-yyyy").parse("24-Nov-2002"));
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
System.out.println(sdf.format(cal.getTime()));
} catch (ParseException e) { e.printStackTrace(); }
감사합니다 모두가 answer.'try를 {찾아보십시오 \t \t \t 일정 칼 = Calendar.getInstance(); \t \t \t cal.setTime (새 SimpleDateFormat ("dd-MMM-yyyy") .parse ("24-Nov-2002"))); \t \t \t SimpleDateFormat sdf = new SimpleDateFormat ("dd-MM-yyyy"); \t \t \t System.out.println (sdf.format (cal.getTime())); \t \t} catch (ParseException e) { \t \t \t e.printStackTrace(); \t \t} ' –