code: public Instant truncatedTo(TemporalUnit unit) {
          if (unit == ChronoUnit.NANOS) {
              return this;
          }
          Duration unitDur = unit.getDuration();
          if (unitDur.getSeconds() > LocalTime.SECONDS_PER_DAY) {
              throw new UnsupportedTemporalTypeException("Unit is too large to be used for truncation");
          }
          long dur = unitDur.toNanos();
          if ((LocalTime.NANOS_PER_DAY % dur) != 0) {
              throw new UnsupportedTemporalTypeException("Unit must divide into a standard day without remainder");
          }
          long nod = (seconds % LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + nanos;
          long result = (nod / dur) * dur;
          return plusNanos(result - nod);
      }
docs: Returns a copy of this {@code Instant} truncated to the specified unit.
  <p>
  Truncating the instant returns a copy of the original with fields
  smaller than the specified unit set to zero.
  The fields are calculated on the basis of using a UTC offset as seen
  in {@code toString}.
  For example, truncating with the {@link ChronoUnit#MINUTES MINUTES} unit will
  round down to the nearest minute, setting the seconds and nanoseconds to zero.
  <p>
  The unit must have a {@linkplain TemporalUnit#getDuration() duration}
  that divides into the length of a standard day without remainder.
  This includes all supplied time units on {@link ChronoUnit} and
  {@link ChronoUnit#DAYS DAYS}. Other units throw an exception.
  <p>
  This instance is immutable and unaffected by this method call.
  
  @param unit  the unit to truncate to, not null
  @return an {@code Instant} based on this instant with the time truncated, not null
  @throws DateTimeException if the unit is invalid for truncation
  @throws UnsupportedTemporalTypeException if the unit is not supported