Function: calcFunc-date
calcFunc-date is an autoloaded and byte-compiled function defined in
calc-forms.el.gz.
Signature
(calcFunc-date DATE &optional MONTH DAY HOUR MINUTE SECOND)
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-forms.el.gz
(defun calcFunc-date (date &optional month day hour minute second)
(and (math-messy-integerp month) (setq month (math-trunc month)))
(and month (not (integerp month)) (math-reject-arg month 'fixnump))
(and (math-messy-integerp day) (setq day (math-trunc day)))
(and day (not (integerp day)) (math-reject-arg day 'fixnump))
(if (and (eq (car-safe hour) 'hms) (not minute))
(setq second (nth 3 hour)
minute (nth 2 hour)
hour (nth 1 hour)))
(and (math-messy-integerp hour) (setq hour (math-trunc hour)))
(and hour (not (integerp hour)) (math-reject-arg hour 'fixnump))
(and (math-messy-integerp minute) (setq minute (math-trunc minute)))
(and minute (not (integerp minute)) (math-reject-arg minute 'fixnump))
(and (math-messy-integerp second) (setq second (math-trunc second)))
(and second (not (math-realp second)) (math-reject-arg second 'realp))
(if month
(progn
(and (math-messy-integerp date) (setq date (math-trunc date)))
(and date (not (math-integerp date)) (math-reject-arg date 'integerp))
(if day
(if hour
(list 'date (math-dt-to-date (list date month day hour
(or minute 0)
(or second 0))))
(list 'date (math-dt-to-date (list date month day))))
(list 'date (math-dt-to-date (list (math-this-year) date month)))))
(if (math-realp date)
(list 'date date)
(if (eq (car date) 'date)
(nth 1 date)
(math-reject-arg date 'datep)))))