Function: calendar-interval

calendar-interval is a byte-compiled function defined in calendar.el.gz.

Signature

(calendar-interval MON1 YR1 MON2 YR2)

Documentation

The number of months difference between MON1, YR1 and MON2, YR2.

The result is positive if the second date is later than the first. Negative years are interpreted as years BC; -1 being 1 BC, and so on.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/calendar.el.gz
(defun calendar-interval (mon1 yr1 mon2 yr2)
  "The number of months difference between MON1, YR1 and MON2, YR2.
The result is positive if the second date is later than the first.
Negative years are interpreted as years BC; -1 being 1 BC, and so on."
  (if (< yr1 0) (setq yr1 (1+ yr1)))      ; -1 BC -> 0 AD, etc
  (if (< yr2 0) (setq yr2 (1+ yr2)))
  (+ (* 12 (- yr2 yr1))
     (- mon2 mon1)))