Java LocalTime repDiff(LocalTime start, LocalTime end, byte type)

Here you can find the source of repDiff(LocalTime start, LocalTime end, byte type)

Description

Reports the difference between two LocalTimes reports total difference in one unit of time

License

Open Source License

Parameter

Parameter Description
start starting time
end ending time
type unit of time reported

Declaration

public static void repDiff(LocalTime start, LocalTime end, byte type) 

Method Source Code

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

import java.time.Duration;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;

public class Main {
    /**/*from  ww w  .j  av  a 2  s  .co  m*/
     * Reports the difference between two LocalTimes
     * reports total difference in one unit of time
     *
     * @param start starting time
     * @param end   ending time
     * @param type  unit of time reported
     */
    public static void repDiff(LocalTime start, LocalTime end, byte type) {
        switch (type) {
        case 0:
            //Hours
            break;
        case 1:
            long diff = Duration.between(start, end).get(ChronoUnit.MINUTES);
            break;
        case 2:
            //seconds
            break;
        default:
            break;
        }
    }
}

Related

  1. fastTimeWrite(LocalTime localTime)
  2. getTimeDiff(LocalTime start, LocalTime end)
  3. isBetween(LocalTime lt, LocalTime startTime, LocalTime endTime)
  4. isLocalTimeInRange(LocalTime value, LocalTime optionalMinimum, LocalTime optionalMaximum, boolean inclusiveOfEndpoints)
  5. parseLocalTime(String string)
  6. reportTimeDiff(LocalTime start, LocalTime end)
  7. toLocalTime(Date date)