Java LocalDateTime to getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit)

Here you can find the source of getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit)

Description

get Duration String

License

Open Source License

Declaration

public static String getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.time.LocalDateTime;

import java.time.temporal.ChronoUnit;

public class Main {
    public static String getDurationString(LocalDateTime start, LocalDateTime end, ChronoUnit unit) {
        return unit.between(start, end) + " " + unit.name();
    }/*from www  .  j a  v a2 s  .  com*/
}

Related

  1. getDate(LocalDateTime time)
  2. getDateTimeText(LocalDateTime dateTime)
  3. getDelayUntil(final LocalDateTime ldt)
  4. getDifference(LocalDateTime sourceTime, LocalDateTime targetTime)
  5. getDurationInMillis(LocalDateTime from, LocalDateTime to)
  6. getHoursElapsed(LocalDateTime fromDate)
  7. getMillis(LocalDateTime time)
  8. getMinuteOfDay(LocalDateTime ldt)
  9. getSecondsSinceJavaEpoch(LocalDateTime localDateTime)