Function: calendar-chinese-date-string
calendar-chinese-date-string is an autoloaded and byte-compiled
function defined in cal-china.el.gz.
Signature
(calendar-chinese-date-string &optional DATE)
Documentation
String of Chinese date of Gregorian DATE.
Defaults to today's date if DATE is not given.
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/cal-china.el.gz
;;;###cal-autoload
(defun calendar-chinese-date-string (&optional date)
"String of Chinese date of Gregorian DATE.
Defaults to today's date if DATE is not given."
(let* ((a-date (calendar-absolute-from-gregorian
(or date (calendar-current-date))))
(c-date (calendar-chinese-from-absolute a-date))
(cycle (car c-date))
(year (cadr c-date))
(month (nth 2 c-date))
(day (nth 3 c-date))
(this-month (calendar-chinese-to-absolute
(list cycle year month 1)))
(next-month (calendar-chinese-to-absolute
(list (if (= year 60) (1+ cycle) cycle)
(if (= (floor month) 12) (1+ year) year)
;; Remainder of (1+(floor month))/12, with
;; 12 instead of 0.
(1+ (mod (floor month) 12))
1))))
(format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)"
cycle
year (calendar-chinese-sexagesimal-name year)
(if (not (integerp month))
"second "
(if (< 30 (- next-month this-month))
"first "
""))
(floor month)
(if (integerp month)
(format " (%s)" (calendar-chinese-sexagesimal-name
(+ (* 12 year) month 50)))
"")
day (calendar-chinese-sexagesimal-name (+ a-date 15)))))