두 날짜 간의 차이를 초 단위로 계산하려면 어떻게해야합니까?두 초 사이의 차이를 얻으려면 dateTime
나는이있다 :이 경우
LocalDateTime now = LocalDateTime.now(); // current date and time
LocalDateTime midnight = now.toLocalDate().atStartOfDay().plusDays(1); //midnight
을 때입니다 : now 2017-09-14T09:49:25.316 midnight 2017-09-15T00:00
내가 반환 51,035
이다 것인지,이 경우,int second = ...?
그리고 결과를 계산하는 방법
내가 어떻게 할 수 있습니까?
DateTime now = DateTime.now();
DateTime midnight = now.withTimeAtStartOfDay().plusDays(1);
Seconds seconds = Seconds.secondsBetween(now, midnight);
int diff = seconds.getSeconds();
이제 정수 변수에 초 단위로 날짜 beetween 차이를 반환 :
를 해결했다.업그레이드 내가 이것을 시도
모든 사용자에게 답변 해 주셔서 감사합니다.
이 자바 죄송 –