X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Ftime.lisp;fp=sql%2Ftime.lisp;h=66731c13531f8e12f6eadf8963ec5a21cb67b2a8;hp=554bc17984fa5c1931706b632eb8eaf8dcb3b079;hb=c81a9fe27ee259429b89ef680788abb8f8e1b26a;hpb=6a86cd362b2b952c9a819dea1df43efd3fd8bab3 diff --git a/sql/time.lisp b/sql/time.lisp index 554bc17..66731c1 100644 --- a/sql/time.lisp +++ b/sql/time.lisp @@ -1315,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)