Это мой фрагмент кода
Код: Выделить всё
public void createMessage(userinfo,long start,long end){
Long startDateInMilliSec = start;
Long endDateInMilliSec = end;
DateTime startDateTime = new DateTime(start);
DateTime endTimeForThisDay = startDateTime.plusDays(1).withMillisOfDay(0);
Interval i = new Interval(startDateTime, endTimeForThisDay);
...
}
Код: Выделить всё
ZonedDateTime startDateTime = startInstant.atZone(ZoneId.of("America/Chicago"));
Instant endInstant = startInstant.plus(1, ChronoUnit.DAYS);
ZonedDateTime endTimeForThisDay = endInstant.atZone(ZoneId.of("America/Chicago"));
Duration i = Duration.between(startDateTime, endTimeForThisDay);
Подробнее здесь: https://stackoverflow.com/questions/798 ... -java-time