Function: calendar-chinese-to-absolute
calendar-chinese-to-absolute is a byte-compiled function defined in
cal-china.el.gz.
Signature
(calendar-chinese-to-absolute DATE)
Documentation
The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
DATE is a Chinese date (cycle year month day). The Gregorian date Sunday, December 31, 1 BC is imaginary.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-china.el.gz
(defun calendar-chinese-to-absolute (date)
"The number of days elapsed between the Gregorian date 12/31/1 BC and DATE.
DATE is a Chinese date (cycle year month day). The Gregorian date
Sunday, December 31, 1 BC is imaginary."
(let* ((cycle (car date))
(year (cadr date))
(month (nth 2 date))
(day (nth 3 date))
(g-year (+ (* (1- cycle) 60) ; years in prior cycles
(1- year) ; prior years this cycle
-2636))) ; years before absolute date 0
(+ (1- day) ; prior days this month
(cadr ; absolute date of start of this month
(assoc month (append (memq (assoc 1 (calendar-chinese-year g-year))
(calendar-chinese-year g-year))
(calendar-chinese-year (1+ g-year))))))))