현재 시스템 시간을 가져 와서 포맷터 SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
을 통해 구문 분석하고 싶습니다.SimpleDateFormat을 통해 시스템 시간을 구문 분석 할 때 오류가 발생했습니다.
public static void currentSystemTime() {
Calendar calendar = new GregorianCalendar();
try {
System.out.println(format.parse(calendar.getTime().toString()));
} catch (ParseException ex) {
Logger.getLogger(DateDifference.class.getName()).log(Level.SEVERE, null, ex);
}
}
가 어떻게 SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
일치하는 문자 형식으로 시스템 시간을 얻을 수 있습니다 :
나는 아래의 방법에 사용 .... error : java.text.ParseException: Unparseable date: "Tue Jan 13 17:05:51 PST 2015"
을 얻을?
왜? 왜 LocalDateTime.Now()를 사용하여 현재 시간을 얻지 않습니까? –