Exemple #1
0
  /**
   * Set the milliseconds of the datetime.
   *
   * <p>All changes to the millisecond field occurs via this method.
   *
   * @param instant the milliseconds since 1970-01-01T00:00:00Z to set the datetime to
   */
  public void setMillis(long instant) {
    switch (iRoundingMode) {
      case ROUND_NONE:
        break;
      case ROUND_FLOOR:
        instant = iRoundingField.roundFloor(instant);
        break;
      case ROUND_CEILING:
        instant = iRoundingField.roundCeiling(instant);
        break;
      case ROUND_HALF_FLOOR:
        instant = iRoundingField.roundHalfFloor(instant);
        break;
      case ROUND_HALF_CEILING:
        instant = iRoundingField.roundHalfCeiling(instant);
        break;
      case ROUND_HALF_EVEN:
        instant = iRoundingField.roundHalfEven(instant);
        break;
    }

    super.setMillis(instant);
  }
Exemple #2
0
 /**
  * Set the chronology of the datetime.
  *
  * <p>All changes to the chronology occur via this method.
  *
  * @param chronology the chronology to use, null means ISOChronology in default zone
  */
 public void setChronology(Chronology chronology) {
   super.setChronology(chronology);
 }