Java Utililty Methods LocalTime

List of utility methods to do LocalTime

Description

The list of methods to do LocalTime are organized into topic(s).

Method

voidreportTimeDiff(LocalTime start, LocalTime end)
This method will print (to System.out) the difference in time between a starting and an ending time
end = end.minusHours(start.getHour());
end = end.minusMinutes(start.getMinute());
end = end.minusSeconds(start.getSecond());
end = end.minusNanos(start.getNano());
System.out.print("Computed in ");
if (end.getHour() != 0) {
    System.out.print(end.getHour() + " Hours, ");
if (end.getMinute() != 0) {
    System.out.print(end.getMinute() + " Minutes, ");
if (end.getSecond() != 0 || end.getNano() != 0) {
    int nanos = (int) (end.getNano() / pow(10, 4));
    System.out.print(end.getSecond() + "." + nanos + " Seconds");
} else {
    System.out.print("less than 0.001 second");
LocalTimetoLocalTime(Date date)
Convert a Date value into a LocalTime , using default calendar and default time zone.
return toLocalTime(date, null);