public static LocalTime now(Clock clock) {
        Objects.requireNonNull(clock, "clock");
        // inline OffsetTime factory to avoid creating object and InstantProvider checks
        final Instant now = clock.instant();  // called once
        ZoneOffset offset = clock.getZone().getRules().getOffset(now);
        long localSecond = now.getEpochSecond() + offset.getTotalSeconds();  // overflow caught later
        int secsOfDay = (int) Math.floorMod(localSecond, SECONDS_PER_DAY);
        return ofNanoOfDay(secsOfDay * NANOS_PER_SECOND + now.getNano());
    }
public static LocalTime now ( Clock clock ) { Objects . requireNonNull ( clock , "clock" ) ; final Instant now = clock . instant ( ) ; ZoneOffset offset = clock . getZone ( ) . getRules ( ) . getOffset ( now ) ; long localSecond = now . getEpochSecond ( ) + offset . getTotalSeconds ( ) ; int secsOfDay = ( int ) Math . floorMod ( localSecond , SECONDS_PER_DAY ) ; return ofNanoOfDay ( secsOfDay * NANOS_PER_SECOND + now . getNano ( ) ) ; }
Obtains the current time from the specified clock.
<p>
This will query the specified clock to obtain the current time.
Using this method allows the use of an alternate clock for testing.
The alternate clock may be introduced using {@link Clock dependency injection}.

@param clock  the clock to use, not null
@return the current time, not null