Function: calendar-hebrew-from-absolute

calendar-hebrew-from-absolute is a byte-compiled function defined in cal-hebrew.el.gz.

Signature

(calendar-hebrew-from-absolute DATE)

Documentation

Compute the Hebrew date (month day year) corresponding to absolute DATE.

The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-hebrew.el.gz
       -1373429)))               ; days elapsed before absolute date 1

(defun calendar-hebrew-from-absolute (date)
  "Compute the Hebrew date (month day year) corresponding to absolute DATE.
The absolute date is the number of days elapsed since the (imaginary)
Gregorian date Sunday, December 31, 1 BC."
  (let* ((greg-date (calendar-gregorian-from-absolute date))
         (year (+ 3760 (calendar-extract-year greg-date)))
         (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
                      (1- (calendar-extract-month greg-date))))
         (length (progn
                   (while (>= date (calendar-hebrew-to-absolute
                                    (list 7 1 (1+ year))))
                     (setq year (1+ year)))
                   (calendar-hebrew-last-month-of-year year)))
         day)
    (while (> date
              (calendar-hebrew-to-absolute
               (list month
                     (calendar-hebrew-last-day-of-month month year)
                     year)))
      (setq month (1+ (% month length))))
    (setq day (1+
               (- date (calendar-hebrew-to-absolute (list month 1 year)))))
    (list month day year)))