Browse files

treat 02/29 like 02/28 in timestamp-full-year-difference

  • Loading branch information...
1 parent 5797a11 commit 39ed180f2d4e09dbddc96c5afadbbaa5016864fd @hanshuebner hanshuebner committed Jan 9, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/local-time.lisp
View
6 src/local-time.lisp
@@ -802,7 +802,11 @@ the previous day given by OFFSET."
(decode-timestamp time-a)
(declare (ignore nsec-b sec-b minute-b hour-b day-b month-b day-of-week-b daylight-p-b zone-b))
(let ((year-difference (- year-b year-a)))
- (if (timestamp<= (encode-timestamp nsec-a sec-a minute-a hour-a day-a month-a
+ (if (timestamp<= (encode-timestamp nsec-a sec-a minute-a hour-a
+ (if (= month-a 2)
+ (min 28 day-a)
+ day-a)
+ month-a
(+ year-difference year-a))
time-a)
year-difference

0 comments on commit 39ed180

Please sign in to comment.