The list of methods to do LocalTime are organized into topic(s).
boolean
currentTimeIsBetween(LocalTime from, LocalTime to) Check if current time is between given local times
LocalTime current = LocalTime.now();
if (from == null || to == null)
return true;
return (current.isAfter(from) && current.isBefore(to)) || current.equals(from) || current.equals(to);
char[]
fastTimeWrite(LocalTime localTime) fast Time Write
char[] c = new char[5];
int h = localTime.getHour();
c[0] = (char) ('0' + (h / 10));
c[1] = (char) ('0' + (h % 10));
c[2] = (char) (':');
int m = localTime.getMinute();
c[3] = (char) ('0' + (m / 10));
c[4] = (char) ('0' + (m % 10));
...
boolean
isLocalTimeInRange(LocalTime value, LocalTime optionalMinimum, LocalTime optionalMaximum, boolean inclusiveOfEndpoints) isLocalTimeInRange, This returns true if the specified value is inside of the specified range.
LocalTime minimum = (optionalMinimum == null) ? LocalTime.MIN : optionalMinimum;
LocalTime maximum = (optionalMaximum == null) ? LocalTime.MAX : optionalMaximum;
if (value == null) {
return false;
if (maximum.isBefore(minimum) || maximum.equals(minimum)) {
return false;
if (inclusiveOfEndpoints) {
return ((value.isAfter(minimum) || value.equals(minimum))
&& (value.isBefore(maximum) || value.equals(maximum)));
} else {
return (value.isAfter(minimum) && value.isBefore(maximum));
void
repDiff(LocalTime start, LocalTime end, byte type) Reports the difference between two LocalTimes reports total difference in one unit of time
switch (type) {
case 0:
break;
case 1:
long diff = Duration.between(start, end).get(ChronoUnit.MINUTES);
break;
case 2:
break;
...