Код: Выделить всё
public static void main(String[] args) {
LocalTime start = LocalTime.of(10, 12, 0);
LocalTime midnight = LocalTime.of(23, 59, 59);
for (LocalTime t = start; t.isBefore(midnight); t = t.plusMinutes(30)) {
System.out.println(t);
}
}
Код: Выделить всё
10:12
10:42
11:12
11:42
12:12
...
...
21:42
22:12
22:42
23:12
23:42
Подробнее здесь: https://stackoverflow.com/questions/793 ... midnight-w
Мобильная версия