/** * Returns a copy of this datetime plus the specified number of millis. * <p> * The calculation will add a duration equivalent to the number of milliseconds. * <p> * The following three lines are identical in effect: * <pre> * DateTime added = dt.plusMillis(6); * DateTime added = dt.plus(Period.millis(6)); * DateTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * <p> * This datetime instance is immutable and unaffected by this method call. * * @param millis the amount of millis to add, may be negative * @return the new datetime plus the increased millis * @since 1.1 */ public DateTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getMillis(), millis); return withMillis(instant); }
if (isSupported(f = chrono.millis())) { millis = f;
/** * Returns a copy of this datetime minus the specified number of millis. * <p> * The calculation will subtract a duration equivalent to the number of * milliseconds. * <p> * The following three lines are identical in effect: * <pre> * DateTime subtracted = dt.minusMillis(6); * DateTime subtracted = dt.minus(Period.millis(6)); * DateTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * <p> * This datetime instance is immutable and unaffected by this method call. * * @param millis the amount of millis to subtract, may be negative * @return the new datetime minus the increased millis * @since 1.1 */ public DateTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getMillis(), millis); return withMillis(instant); }
if (isSupported(f = chrono.millis())) { millis = f;
/** * Returns a copy of this datetime minus the specified number of millis. * <p> * The calculation will subtract a duration equivalent to the number of * milliseconds. * <p> * The following three lines are identical in effect: * <pre> * DateTime subtracted = dt.minusMillis(6); * DateTime subtracted = dt.minus(Period.millis(6)); * DateTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * <p> * This datetime instance is immutable and unaffected by this method call. * * @param millis the amount of millis to subtract, may be negative * @return the new datetime minus the increased millis * @since 1.1 */ public DateTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getMillis(), millis); return withMillis(instant); }
/** * Returns a copy of this datetime plus the specified number of millis. * <p> * The calculation will add a duration equivalent to the number of milliseconds. * <p> * The following three lines are identical in effect: * <pre> * DateTime added = dt.plusMillis(6); * DateTime added = dt.plus(Period.millis(6)); * DateTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * <p> * This datetime instance is immutable and unaffected by this method call. * * @param millis the amount of millis to add, may be negative * @return the new datetime plus the increased millis * @since 1.1 */ public DateTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getMillis(), millis); return withMillis(instant); }
/** * Add a number of milliseconds to the date. The implementation of this * method differs from the {@link #add(long)} method in that a * DateTimeField performs the addition. * * @param millis the milliseconds to add * @throws IllegalArgumentException if the value is invalid */ public void addMillis(final int millis) { if (millis != 0) { setMillis(getChronology().millis().add(getMillis(), millis)); } }
/** * Add a number of milliseconds to the date. The implementation of this * method differs from the {@link #add(long)} method in that a * DateTimeField performs the addition. * * @param millis the milliseconds to add * @throws IllegalArgumentException if the value is invalid */ public void addMillis(final int millis) { if (millis != 0) { setMillis(getChronology().millis().add(getMillis(), millis)); } }
/** * Returns a copy of this datetime minus the specified number of millis. * <p> * This LocalDateTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalDateTime subtracted = dt.minusMillis(6); * LocalDateTime subtracted = dt.minus(Period.millis(6)); * LocalDateTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * * @param millis the amount of millis to subtract, may be negative * @return the new LocalDateTime minus the increased millis */ public LocalDateTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this datetime plus the specified number of millis. * <p> * This LocalDateTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalDateTime added = dt.plusMillis(6); * LocalDateTime added = dt.plus(Period.millis(6)); * LocalDateTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * * @param millis the amount of millis to add, may be negative * @return the new LocalDateTime plus the increased millis */ public LocalDateTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this time minus the specified number of millis. * <p> * This LocalTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalTime subtracted = dt.minusMillis(6); * LocalTime subtracted = dt.minus(Period.millis(6)); * LocalTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * * @param millis the amount of millis to subtract, may be negative * @return the new LocalTime minus the increased millis */ public LocalTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this time plus the specified number of millis. * <p> * This LocalTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalTime added = dt.plusMillis(6); * LocalTime added = dt.plus(Period.millis(6)); * LocalTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * * @param millis the amount of millis to add, may be negative * @return the new LocalTime plus the increased millis */ public LocalTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this datetime plus the specified number of millis. * <p> * This LocalDateTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalDateTime added = dt.plusMillis(6); * LocalDateTime added = dt.plus(Period.millis(6)); * LocalDateTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * * @param millis the amount of millis to add, may be negative * @return the new LocalDateTime plus the increased millis */ public LocalDateTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this time plus the specified number of millis. * <p> * This LocalTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalTime added = dt.plusMillis(6); * LocalTime added = dt.plus(Period.millis(6)); * LocalTime added = dt.withFieldAdded(DurationFieldType.millis(), 6); * </pre> * * @param millis the amount of millis to add, may be negative * @return the new LocalTime plus the increased millis */ public LocalTime plusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().add(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this time minus the specified number of millis. * <p> * This LocalTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalTime subtracted = dt.minusMillis(6); * LocalTime subtracted = dt.minus(Period.millis(6)); * LocalTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * * @param millis the amount of millis to subtract, may be negative * @return the new LocalTime minus the increased millis */ public LocalTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getLocalMillis(), millis); return withLocalMillis(instant); }
/** * Returns a copy of this datetime minus the specified number of millis. * <p> * This LocalDateTime instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * LocalDateTime subtracted = dt.minusMillis(6); * LocalDateTime subtracted = dt.minus(Period.millis(6)); * LocalDateTime subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6); * </pre> * * @param millis the amount of millis to subtract, may be negative * @return the new LocalDateTime minus the increased millis */ public LocalDateTime minusMillis(int millis) { if (millis == 0) { return this; } long instant = getChronology().millis().subtract(getLocalMillis(), millis); return withLocalMillis(instant); }
return chronology.seconds(); case MILLIS: return chronology.millis(); default:
return chronology.seconds(); case MILLIS: return chronology.millis(); default: