@Override
  public long periodUntil(DateTime endDateTime, PeriodUnit unit) {

    if (endDateTime instanceof OffsetDateTime == false) {
      throw new DateTimeException("Unable to calculate period between objects of two different types");
    }
    if (unit instanceof ChronoUnit) {
      OffsetDateTime end = (OffsetDateTime) endDateTime;
      end = end.withOffsetSameInstant(this.offset);
      return this.dateTime.periodUntil(end.dateTime, unit);
    }
    return unit.between(this, endDateTime).getAmount();
  }