format-time-string

Akihiro Arisawa ari @ atesoft.advantest.co.jp
2000年 3月 8日 (水) 12:37:39 JST


有沢です。

Mule-2.3 @ Emacs-19.28 で format-time-string に "%d" を指定した時に、
zero-padded されません。"%D" も同様です。

| (format-time-string "%d" (current-time))
| " 8"
| (format-time-string "%D" (current-time))
| "03/ 8/00"

2000-03-08  Akihiro Arisawa  <ari @ atesoft.advantest.co.jp>

	* poe.el (format-time-string): Fix problem when `format' contains "%d"
        or "%D".

-------------- next part --------------
Index: poe.el
===================================================================
RCS file: /cvs/root/apel/poe.el,v
retrieving revision 1.66
diff -u -r1.66 poe.el
--- poe.el	2000/03/04 15:17:37	1.66
+++ poe.el	2000/03/08 02:39:18
@@ -1268,13 +1268,13 @@
 		  "")
 		 ;; the day of month, zero-padded
 		 ((eq cur-char ?d)	
-		  (substring time-string 8 10))
+		  (format "%02d" (string-to-int (substring time-string 8 10))))
 		 ;; a synonym for `%m/%d/%y'
 		 ((eq cur-char ?D)
-		  (format "%02d/%s/%s"
+		  (format "%02d/%02d/%s"
 			  (cddr (assoc (substring time-string 4 7)
 				       format-time-month-list))
-			  (substring time-string 8 10)
+			  (string-to-int (substring time-string 8 10))
 			  (substring time-string -2)))
 		 ;; the day of month, blank-padded
 		 ((eq cur-char ?e)
-------------- next part --------------

-- 
有沢 明宏


More information about the APEL-ja mailing list