List of utility methods to do LocalTime
void | reportTimeDiff(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"); |
LocalTime | toLocalTime(Date date) Convert a Date value into a LocalTime , using default calendar and default time zone. return toLocalTime(date, null);
|