Getting time range between midnight and current time JDK 8
I have this method to calculate midnigt and current time as long values: /** * Returns the time range between the midnight and current time in milliseconds. * * @param zoneId time zone ID. * @return a {@code long} array, where at index: 0 - midnight time; 1 - current time. */ public static long[] todayDateRange(ZoneId zoneId) { long[] toReturn = new long[2]; LocalTime midnight = LocalTime.MIDNIGHT; LocalDate today = LocalDate.now(zoneId); LocalDateTime todayMidnight = LocalDateTime.of(today, midnight); ZonedDateTime todayMidnightZdt = todayMidnight.atZone(zoneId); toReturn[0] =