/** * <p>Creates a finite half-open interval between midnight at start of day * and given end time. </p> * * @param end time of upper boundary (exclusive) * @return new time interval * @see #until(PlainTime) * @since 4.11 */ /*[deutsch] * <p>Erzeugt ein begrenztes halb-offenes Intervall zwischen Mitternacht * zu Beginn des Tages und der angegebenen Endzeit. </p> * * @param end time of upper boundary (exclusive) * @return new time interval * @see #until(PlainTime) * @since 4.11 */ public static ClockInterval until(LocalTime end) { return ClockInterval.until(PlainTime.from(end)); }
/** * <p>Creates a finite half-open interval between given start time and * midnight at end of day (exclusive). </p> * * @param start time of lower boundary (inclusive) * @return new time interval * @see #since(PlainTime) * @since 4.11 */ /*[deutsch] * <p>Erzeugt ein begrenztes halb-offenes Intervall zwischen der * angegebenen Startzeit und Mitternacht zu Ende des Tages (exklusive). </p> * * @param start time of lower boundary (inclusive) * @return new time interval * @see #since(PlainTime) * @since 4.11 */ public static ClockInterval since(LocalTime start) { return ClockInterval.since(PlainTime.from(start)); }
@Override public PlainTime createFrom( TimeSource<?> clock, final AttributeQuery attributes ) { Timezone zone; if (attributes.contains(Attributes.TIMEZONE_ID)) { zone = Timezone.of(attributes.get(Attributes.TIMEZONE_ID)); } else if (attributes.get(Attributes.LENIENCY, Leniency.SMART).isLax()) { zone = Timezone.ofSystem(); } else { return null; } final UnixTime ut = clock.currentTime(); return PlainTime.from(ut, zone.getOffset(ut)); }