Function: calendar-persian-from-absolute

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

Signature

(calendar-persian-from-absolute DATE)

Documentation

Compute the Persian equivalent for absolute date DATE.

The result is a list of the form (MONTH DAY YEAR). 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-persia.el.gz
(defun calendar-persian-from-absolute (date)
  "Compute the Persian equivalent for absolute date DATE.
The result is a list of the form (MONTH DAY YEAR).
The absolute date is the number of days elapsed since the imaginary
Gregorian date Sunday, December 31, 1 BC."
  (let* ((year (calendar-persian-year-from-absolute date))
         (month                        ; search forward from Farvardin
          (1+ (calendar-sum m 1
                            (> date
                               (calendar-persian-to-absolute
                                (list
                                 m
                                 (calendar-persian-last-day-of-month m year)
                                 year)))
                            1)))
         (day                       ; calculate the day by subtraction
          (- date (1- (calendar-persian-to-absolute
                       (list month 1 year))))))
    (list month day year)))