@Override public int getHour() { return this.time.getHour(); }
private PlainTimestamp( PlainDate date, PlainTime time ) { super(); if (time.getHour() == 24) { // T24 normalisieren this.date = date.plus(1, DAYS); this.time = PlainTime.MIN; } else if (date == null) { throw new NullPointerException("Missing date."); } else { this.date = date; this.time = time; } }
if (key.getHour() == 24) { map.put(PlainTime.midnightAtStartOfDay(), timeToLabels.get(key)); map.remove(key);
private static void writeTime( PlainTime time, DataOutput out ) throws IOException { if (time.getNanosecond() == 0) { if (time.getSecond() == 0) { if (time.getMinute() == 0) { out.writeByte(~time.getHour()); } else { out.writeByte(time.getHour()); out.writeByte(~time.getMinute()); } } else { out.writeByte(time.getHour()); out.writeByte(time.getMinute()); out.writeByte(~time.getSecond()); } } else { out.writeByte(time.getHour()); out.writeByte(time.getMinute()); out.writeByte(time.getSecond()); out.writeInt(time.getNanosecond()); } }
/** * <p>Determines the end of the day period which covers given clock time. </p> * * @param context the clock time a day period is searched for * @return end of day period around given clock time, exclusive * @see #getStart(PlainTime) * @since 3.13/4.10 */ /*[deutsch] * <p>Ermittelt das Ende des Tagesabschnitts, der die angegebene Uhrzeit enthält. </p> * * @param context the clock time a day period is searched for * @return end of day period around given clock time, exclusive * @see #getStart(PlainTime) * @since 3.13/4.10 */ public PlainTime getEnd(PlainTime context) { PlainTime compare = ( (context.getHour() == 24) ? PlainTime.midnightAtStartOfDay() : context); for (PlainTime key : this.codeMap.keySet()) { if (compare.isBefore(key)) { return key; } } return this.codeMap.firstKey(); }
(context.getHour() == 24) ? PlainTime.midnightAtStartOfDay() : context);
private GeneralTimestamp( CalendarVariant<?> cv, Calendrical<?, ?> ca, PlainTime time ) { super(); if (time.getHour() == 24) { // NPE-check if (cv == null) { this.cv = null; this.ca = ca.plus(CalendarDays.of(1)); } else { this.cv = cv.plus(CalendarDays.of(1)); this.ca = null; } this.time = PlainTime.midnightAtStartOfDay(); } else { this.cv = cv; this.ca = ca; this.time = time; } }
private static Moment moveEventuallyToLS(Moment adjusted) { PlainDate date = adjusted.getDateUTC(); PlainTime time = adjusted.getTimeUTC(); if ( (LeapSeconds.getInstance().getShift(date) == 1) && (time.getHour() == 23) && (time.getMinute() == 59) && (time.getSecond() == 59) ) { return adjusted.plus(1, SI.SECONDS); } else { return adjusted; } }
private FullValueOperator(int type) { super(PlainTime.COMPONENT, type); this.tsop = entity -> { PlainTime time = doApply(entity.getWallTime()); if (time.getHour() == 24) { return PlainTimestamp.of( entity.getCalendarDate().plus(1, DAYS), PlainTime.midnightAtStartOfDay()); } else { return entity.with(time); } }; }
@Override public PlainTimestamp apply(PlainTimestamp entity) { PlainTime oldTime = entity.getWallTime(); if (this.value.isSimultaneous(oldTime)) { return this.handleSameTimes(entity); } else if (this.value.getHour() == 24) { return this.handleMidnight24(entity); } else if (this.value.isAfter(oldTime)) { return this.handleLater(entity); } else { return this.handleEarlier(entity); } }
private PlainTime doApply(PlainTime time) { int hour = time.getHour(); int minute = time.getMinute();
this.date.getDaysSinceUTC() + 2 * 365, 86400); localSeconds += (this.time.getHour() * 3600); localSeconds += (this.time.getMinute() * 60); localSeconds += this.time.getSecond();
/** * <p>Yields the length of this interval. </p> * * @return duration in hours, minutes, seconds and nanoseconds * @since 2.0 */ /*[deutsch] * <p>Liefert die Länge dieses Intervalls. </p> * * @return duration in hours, minutes, seconds and nanoseconds * @since 2.0 */ public Duration<ClockUnit> getDuration() { PlainTime t1 = this.getTemporalOfClosedStart(); PlainTime t2 = this.getEnd().getTemporal(); if (this.getEnd().isClosed()) { if (t2.getHour() == 24) { if (t1.equals(PlainTime.midnightAtStartOfDay())) { return Duration.of(24, HOURS).plus(1, NANOS); } else { t1 = t1.minus(1, NANOS); } } else { t2 = t2.plus(1, NANOS); } } return Duration.inClockUnits().between(t1, t2); }