/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.309 by eweitz, Tue Jun 21 18:28:58 2005 UTC revision 1.310 by mbaringer, Sun Jul 24 15:30:46 2005 UTC
# Line 3659  See `methods-by-applicability'.") Line 3659  See `methods-by-applicability'.")
3659    (declare (ignore inspector))    (declare (ignore inspector))
3660    (values "A number." `("Value: " ,(princ-to-string n))))    (values "A number." `("Value: " ,(princ-to-string n))))
3661    
3662    (defun format-iso8601-time (time-value &optional include-timezone-p)
3663        "Formats a universal time TIME-VALUE in ISO 8601 format, with
3664        the time zone included if INCLUDE-TIMEZONE-P is non-NIL"
3665        ;; Taken from http://www.pvv.ntnu.no/~nsaa/ISO8601.html
3666        ;; Thanks, Nikolai Sandved and Thomas Russ!
3667        (flet ((format-iso8601-timezone (zone)
3668                 (if (zerop zone)
3669                     "Z"
3670                     (multiple-value-bind (h m) (truncate (abs zone) 1.0)
3671                       ;; Tricky.  Sign of time zone is reversed in ISO 8601
3672                       ;; relative to Common Lisp convention!
3673                       (format nil "~:[+~;-~]~2,'0D:~2,'0D"
3674                               (> zone 0) h (round m))))))
3675        (multiple-value-bind (second minute hour day month year dow dst zone)
3676          (decode-universal-time time-value)
3677          (declare (ignore dow dst))
3678          (format nil "~4,'0D-~2,'0D-~2,'0DT~2,'0D:~2,'0D:~2,'0D~:[~*~;~A~]"
3679                  year month day hour minute second
3680                  include-timezone-p (format-iso8601-timezone zone)))))
3681    
3682  (defmethod inspect-for-emacs ((i integer) inspector)  (defmethod inspect-for-emacs ((i integer) inspector)
3683    (declare (ignore inspector))    (declare (ignore inspector))
3684    (values "A number."    (values "A number."
# Line 3671  See `methods-by-applicability'.") Line 3691  See `methods-by-applicability'.")
3691             (label-value-line "Length" (integer-length i))             (label-value-line "Length" (integer-length i))
3692             (ignore-errors             (ignore-errors
3693               (list "As time: "               (list "As time: "
3694                     (multiple-value-bind (sec min hour date month year)                     (format-iso8601-time i t))))))
                        (decode-universal-time i)  
                      (format nil "~4,'0D-~2,'0D-~2,'0DT~2,'0D:~2,'0D:~2,'0DZ"  
                              year month date hour min sec)))))))  
3695    
3696  (defmethod inspect-for-emacs ((c complex) inspector)  (defmethod inspect-for-emacs ((c complex) inspector)
3697    (declare (ignore inspector))    (declare (ignore inspector))

Legend:
Removed from v.1.309  
changed lines
  Added in v.1.310

  ViewVC Help
Powered by ViewVC 1.1.5