CLIM mail archive

[Prev][Next][Index][Thread]

more about that colon problem



What is more surprizing is that the colon after the time gets
correctly printed...:

This works:
(format *nanesse-logging-stream* (string-thin "~a : ")
	(current-time 'letters))

This doesn't:
(format *nanesse-logging-stream* (string-thin "~a : ") 
	(current-time)) 


Where:
1(defun CURRENT-TIME (&optional (mode 'hyphen))
  "Returns a string for the current time in a variety of modes."
  (multiple-value-bind (sec min hour day month year dow) (get-decoded-time)
    (format-date sec min hour day month year dow mode :time-only t)))

(defun FORMAT-DATE (sec min hour day month year dow &optional (mode 'hyphen)
		    &key (time-only nil))
  (if time-only
      (case mode
	(hyphen
	  (format nil "~A"
		  (df-time-string hour min sec 'full)))
	((long fancy)
	 (format nil "~A"
		(df-time-string hour min sec 'ampm)))
0	;; Note by Keunen (24-Nov-92 11:20:55): rajoute ceci
1	0(letters
	  1(format nil "~A"
		  (df-time-string hour min sec '0letters1))0)1)
      (case mode
	(hyphen
	  (format nil "~@:(~A ~A ~A~)"
		  (dow-string dow 'medium)	; 3 letter
		  (date-string month day year 'dd-mmm-yy)
		  (df-time-string hour min sec 'full)))
	((long fancy)
	 (format nil "~A, ~A, ~A"
		 (dow-string dow 'long)
		 (date-string month day year mode)
		 (df-time-string hour min sec 'ampm))))))


(defun DF-TIME-STRING (hour min secs &optional (mode 'full))
  "Formats the current time in a variety of ways."
  ;; ampm vs 24-hour time.
  (case mode
    (full				; 24 hour
     (format nil "~2,'0d:~2,'0d:~2,'0d" hour min secs))
0    ;; Note by Keunen (24-Nov-92 11:22:34) : rajoute ceci
    (letters
      1(format nil "~2,'0d0h1~2,'0d0m1~2,'0d0s1" hour min secs)0)
1    (ampm
     (let ((h (1+ (mod (+ hour 11.) 12.)))
	   (ampm (or (> hour 12.) (zerop hour))))
       (if (and (zerop secs)(zerop min) (= h 12))
	   ;; midnight, noon
	   (if (zerop hour) "midnight" "noon")
	 (format nil "~d:~2,'0d:~2,'0d ~:[am~;pm~]"
		 h min secs ampm))))))

0--
Never trust a pretty header: use keunen@nrb.be to reply
--
Keunen Vincent                  Network Research Belgium
R&D, Software Engineer          Parc Industriel des Hauts-Sarts
keunen@nrb.be                   2e Avenue, 65
tel: +32 41 407282              B-4040 Herstal
fax: +32 41 481170              Belgium

0,,


Main Index | Thread Index