Convenience function add-years
This commit is contained in:
parent
f6dd1f2d90
commit
9bb852795e
1 changed files with 4 additions and 1 deletions
|
|
@ -92,6 +92,10 @@ the month is returned."
|
|||
"Retreat date by given number of days"
|
||||
(- date days))
|
||||
|
||||
(defun add-years (date years &key eom-rule)
|
||||
"Add number of years to date (subtract if negative) - see add-months"
|
||||
(add-months date (* 12 years) :eom-rule eom-rule))
|
||||
|
||||
(defun add-months (date months &key eom-rule)
|
||||
"Add number of months to date (negative number will decrement date).
|
||||
The returned date will have the same day as the given date unless that is not a valid
|
||||
|
|
@ -291,4 +295,3 @@ Supported day conventions are:
|
|||
(when (= d1 31)
|
||||
(setf d1 30))
|
||||
(/ (+ (- d2 d1) (* 30 (- m2 m1)) (* 360 (- y2 y1))) 360))))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue