나는 내가 생각했던 다음자바 시간 비교가 실패하는 이유는 무엇입니까?
Date d1 = lib.convertTime("10:30:53.39");
Date d2 = lib.convertTime("10:30:53.4");
System.out.println(d1.after(d2));
사실 같은 반환했을 것이다 그러나
을 예상대로 밀리 초 단위로 날짜 거짓
public Date convertTime(String time) {
SimpleDateFormat parser = new SimpleDateFormat("HH:mm:ss.S");
try {
return parser.parse(time);
}
catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
Date d1 = lib.convertTime("10:30:53.39");
Date d2 = lib.convertTime("10:30:53.40");
System.out.println(d1.after(d2));
수익을 문자열로 변환하려면 다음 방법을 . 내가 도대체 뭘 잘못하고있는 겁니까?