Function: calendar-french-from-absolute
calendar-french-from-absolute is a byte-compiled function defined in
cal-french.el.gz.
Signature
(calendar-french-from-absolute DATE)
Documentation
Compute the French Revolutionary 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-french.el.gz
(1- calendar-french-epoch)))) ; days before start of calendar
(defun calendar-french-from-absolute (date)
"Compute the French Revolutionary 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."
(if (< date calendar-french-epoch)
(list 0 0 0) ; pre-French Revolutionary date
(let* ((approx ; approximation from below
(/ (- date calendar-french-epoch) 366))
(year ; search forward from the approximation
(+ approx
(calendar-sum y approx
(>= date (calendar-french-to-absolute
(list 1 1 (1+ y))))
1)))
(month ; search forward from Vendemiaire
(1+ (calendar-sum m 1
(> date
(calendar-french-to-absolute
(list m
(calendar-french-last-day-of-month
m year)
year)))
1)))
(day ; calculate the day by subtraction
(- date
(1- (calendar-french-to-absolute (list month 1 year))))))
(list month day year))))