Re: duration un/parsing extension

Aleksandar Bakic <a_bakic-/[email protected]> Tue, 4 Apr 2006 12:57:37 -0700 (PDT)
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
Sorry, you may recognize this as part of a previous usec patch. Please ignore
it.

Alex

> @@ -1039,11 +1054,16 @@
>    (unless (= 0 year month)
>      (multiple-value-bind (year-orig month-orig day-orig)
>          (time-ymd date)
> -      (setf date (make-time :year (+ year year-orig)
> -                            :month (+ month month-orig)
> -                            :day day-orig
> -                            :second (time-second date)
> -                            :usec usec))))
> +      (multiple-value-bind (new-year new-month)
> +	  (floor (+ month month-orig (* 12 (+ year year-orig))) 12)
> +	(let ((new-date (make-time :year new-year
> +				   :month new-month
> +				   :day day-orig
> +				   :second (time-second date)
> +				   :usec usec)))
> +	  (if destructive
> +	      (setf (time-mjd date) (time-mjd new-date))
> +	      (setq date new-date))))))
>    (let ((mjd (time-mjd date))
>          (sec (time-second date))
>          (usec (time-usec date)))
> @@ -1054,9 +1074,8 @@
>                          (* 60 minute)
>                          (* 60 60 hour))))
>                 1000000)
> -      (declare (ignore sec-new))
>        (multiple-value-bind (mjd-new sec-new)
> -          (floor sec (* 60 60 24))
> +          (floor sec-new (* 60 60 24))
>          (if destructive
>              (progn
>                (setf (time-mjd date) (+ mjd mjd-new day)


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com