X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Ftime.lisp;h=078e4aa5c39efe888bbfa539c3dc2afb46042d68;hp=70ac8286d4d74f82a64b02af0fe516d9dcd918d6;hb=0e0e260d3c6a995e46336c0b9b08ef19d941bb8b;hpb=a7dbbfced59c82ea5c874b37dfd3c03ecdcc8343 diff --git a/sql/time.lisp b/sql/time.lisp index 70ac828..078e4aa 100644 --- a/sql/time.lisp +++ b/sql/time.lisp @@ -938,7 +938,7 @@ with the given options" (let ((mjd (time-mjd date)) (sec (time-second date)) (usec (time-usec date))) - (multiple-value-bind (usec-new sec) + (multiple-value-bind (sec-new usec-new) (floor (+ usec (* 1000000 (+ sec second @@ -1145,8 +1145,9 @@ formatted date string." (parse-integer string :start 17 :end 19) 0)) (cond - ((or (char= #\, (char string 19)) - (char= #\. (char string 19))) + ((and (> strlen 19) + (or (char= #\, (char string 19)) + (char= #\. (char string 19)))) (multiple-value-bind (parsed-usec usec-end) (parse-integer string :start 20 :junk-allowed t) (setf usec parsed-usec @@ -1185,6 +1186,7 @@ formatted date string." :bad-component (car (find-if (lambda (pair) (null (cdr pair))) `((year . ,year) (month . ,month) - (day . ,day) (hour ,hour) - (minute ,minute) (second ,second) - (timezone ,gmt-sec-offset))))))))) + (day . ,day) (hour . ,hour) + (minute . ,minute) (second . ,second) + (usec . ,usec) + (timezone . ,gmt-sec-offset)))))))))