X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Ftime.lisp;h=66731c13531f8e12f6eadf8963ec5a21cb67b2a8;hb=73f6c23a39a24d04746b00d8fe3878ca7a6233f1;hp=7024fe31c13e4c61010e54f8acec7482cc493ad2;hpb=093a1b15dbdea1f10277414b964797c130719cce;p=clsql.git diff --git a/sql/time.lisp b/sql/time.lisp index 7024fe3..66731c1 100644 --- a/sql/time.lisp +++ b/sql/time.lisp @@ -1071,10 +1071,9 @@ with the given options" (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))) + (sec (time-second date))) (multiple-value-bind (sec-new usec-new) - (floor (+ usec + (floor (+ usec (time-usec date) (* 1000000 (+ sec second (* 60 minute) @@ -1316,16 +1315,18 @@ Will throw a hissy fit if the date string is a duration. Will ignore any precisi (char= #\. (char string 19)))) (multiple-value-bind (parsed-usec usec-end) (parse-integer string :start 20 :junk-allowed t) - (setf usec (or parsed-usec 0) - gmt-sec-offset (if (<= (+ 3 usec-end) strlen) - (let ((skip-to (or (position #\+ string :start 19) - (position #\- string :start 19)))) - (if skip-to - (* 60 60 - (parse-integer string :start skip-to - :end (+ skip-to 3))) - 0)) - 0)))) + (let ((parsed-usec (and parsed-usec + (floor (* parsed-usec (expt 10 (+ 6 (- usec-end) 20))))))) + (setf usec (or parsed-usec 0) + gmt-sec-offset (if (<= (+ 3 usec-end) strlen) + (let ((skip-to (or (position #\+ string :start 19) + (position #\- string :start 19)))) + (if skip-to + (* 60 60 + (parse-integer string :start skip-to + :end (+ skip-to 3))) + 0)) + 0))))) (t (setf usec 0 gmt-sec-offset (if (<= 22 strlen)