Share code snippets.

GetNextHourJava8

Created 1 year ago by anonymous
Get the next hour using Java 8
LocalDateTime time = LocalDateTime.now();
				LocalDateTime nextHour = time.plus(1l, ChronoUnit.HOURS).truncatedTo(ChronoUnit.HOURS)
				                                .plusMinutes(60 * (time.getMinute() / 60));
				long minutes = Duration.between(LocalDateTime.now(), nextHour).toMinutes();