cdm/src/main/java/ucar/nc2/time/CalendarDateUnit.java
public double makeOffsetFromRefDate( CalendarDate date) {
    if (isCalendarField) {
      if (date.equals(baseDate)) return 0.0;
      return date.getDifference(baseDate, periodField);
    } else {
      long msecs = date.getDifferenceInMsecs(baseDate);
      return msecs / period.getValueInMillisecs();
    }
  }
public double makeOffsetFromRefDate( CalendarDate date) {
    if (isCalendarField) {
      if (date.equals(baseDate)) return 0.0;
      return date.getDifference(baseDate, periodField);
    } else {
      long msecs = date.getDifferenceInMsecs(baseDate);
      return msecs / period.getValueInMillisecs();
    }
  }
inverse of makeCalendarDate