Calculate duration until some date I use this code to generate time until some date:

 String dateStop = "25/11/17 09:00:00";

    // Custom date format
    SimpleDateFormat format = new SimpleDateFormat("yy/MM/dd HH:mm:ss");

    LocalDateTime d1 = LocalDateTime.now();
    Date d2 = null;
    try
    {
        d2 = format.parse(dateStop);
    }
    catch (ParseException e)
    {
        e.printStackTrace();
    }

    // Get msec from each, and subtract.
    long diff = d2.getTime() - d1.getTime();

    long days = TimeUnit.MILLISECONDS.toDays(diff);
    long remainingHoursInMillis = diff - TimeUnit.DAYS.toMillis(days);
    long hours = TimeUnit.MILLISECONDS.toHours(remainingHoursInMillis);
    long remainingMinutesInMillis = remainingHoursInMillis - TimeUnit.HOURS.toMillis(hours);
    long minutes = TimeUnit.MILLISECONDS.toMinutes(remainingMinutesInMillis);
    long remainingSecondsInMillis = remainingMinutesInMillis - TimeUnit.MINUTES.toMillis(minutes);
    long seconds = TimeUnit.MILLISECONDS.toSeconds(remainingSecondsInMillis);

    System.out.println("Days: " + days + ", hours: " + hours + ", minutes: " + minutes + ", seconds: " + seconds);


How I can get the same result but with much more less code?
You do not need to use Date, parse, Exception, .... You only need LocalDateTime : 

LocalDateTime d1 = LocalDateTime.now();
LocalDateTime d2 = LocalDateTime.parse("25/11/17 09:00:00", DateTimeFormatter.ofPattern("yy/MM/dd HH:mm:ss"));

long days = d1.until(d2, ChronoUnit.DAYS);
d1 = d1.plusDays(days);
long hours = d1.until(d2, ChronoUnit.HOURS);
d1 = d1.plusHours(hours);
long minutes = d1.until(d2, ChronoUnit.MINUTES);
d1 = d1.plusMinutes(minutes);
long seconds = d1.until(d2, ChronoUnit.SECONDS);

System.out.println(days + " days " + hours + " hours " + minutes + " minutes " + 
                                                         seconds + " seconds.");


Step by step, from large precision to small, it will look the difference with this precision and then add it to be nearer of the target