* @return the local time, never null
* @throws CalendricalException if the nanos of day value is invalid
*/
public static LocalTime fromNanoOfDay(long nanoOfDay) {
if (nanoOfDay < 0) {
throw new CalendricalException("Cannot create LocalTime from nanos of day as value " +
nanoOfDay + " must not be negative");
}
if (nanoOfDay >= NANOS_PER_DAY) {
throw new CalendricalException("Cannot create LocalTime from nanos of day as value " +
nanoOfDay + " must be less than " + NANOS_PER_DAY);
}
int hours = (int) (nanoOfDay / NANOS_PER_HOUR);
nanoOfDay -= hours * NANOS_PER_HOUR;
int minutes = (int) (nanoOfDay / NANOS_PER_MINUTE);