270 |
(string-match "\\`\\(\\(-?[0-9]+\\)/\\)?\\([^%]+\\)?\\(\\(%[-.,:@+_ #^()0-9]*[A-Za-z%][^%]*\\)*%[-.,:@+_ #^()0-9]*[A-Za-z%]\\)?\\([^%]+\\)?\\'" time-stamp-pattern) |
(string-match "\\`\\(\\(-?[0-9]+\\)/\\)?\\([^%]+\\)?\\(\\(%[-.,:@+_ #^()0-9]*[A-Za-z%][^%]*\\)*%[-.,:@+_ #^()0-9]*[A-Za-z%]\\)?\\([^%]+\\)?\\'" time-stamp-pattern) |
271 |
(and (match-beginning 2) |
(and (match-beginning 2) |
272 |
(setq line-limit |
(setq line-limit |
273 |
(string-to-int (match-string 2 time-stamp-pattern)))) |
(string-to-number (match-string 2 time-stamp-pattern)))) |
274 |
(and (match-beginning 3) |
(and (match-beginning 3) |
275 |
(setq ts-start (match-string 3 time-stamp-pattern))) |
(setq ts-start (match-string 3 time-stamp-pattern))) |
276 |
(and (match-beginning 4) |
(and (match-beginning 4) |
558 |
((eq cur-char ?y) ;year |
((eq cur-char ?y) ;year |
559 |
(or alt-form (not (string-equal field-width "")) |
(or alt-form (not (string-equal field-width "")) |
560 |
(time-stamp-conv-warn "%y" "%:y")) |
(time-stamp-conv-warn "%y" "%:y")) |
561 |
(string-to-int (format-time-string "%Y" time))) |
(string-to-number (format-time-string "%Y" time))) |
562 |
((eq cur-char ?Y) ;4-digit year, new style |
((eq cur-char ?Y) ;4-digit year, new style |
563 |
(string-to-int (format-time-string "%Y" time))) |
(string-to-number (format-time-string "%Y" time))) |
564 |
((eq cur-char ?z) ;time zone lower case |
((eq cur-char ?z) ;time zone lower case |
565 |
(if change-case |
(if change-case |
566 |
"" ;discourage %z variations |
"" ;discourage %z variations |
597 |
(let* ((initial-length (length padded-result)) |
(let* ((initial-length (length padded-result)) |
598 |
(desired-length (if (string-equal field-width "") |
(desired-length (if (string-equal field-width "") |
599 |
initial-length |
initial-length |
600 |
(string-to-int field-width)))) |
(string-to-number field-width)))) |
601 |
(if (> initial-length desired-length) |
(if (> initial-length desired-length) |
602 |
;; truncate strings on right, years on left |
;; truncate strings on right, years on left |
603 |
(if (stringp field-result) |
(if (stringp field-result) |
621 |
(format "%%:%c" format-char))) |
(format "%%:%c" format-char))) |
622 |
(if (and alt-form (not (string-equal field-width ""))) |
(if (and alt-form (not (string-equal field-width ""))) |
623 |
"" ;discourage "%:2d" and the like |
"" ;discourage "%:2d" and the like |
624 |
(string-to-int (format-time-string format-string time))))) |
(string-to-number (format-time-string format-string time))))) |
625 |
|
|
626 |
(defvar time-stamp-conversion-warn t |
(defvar time-stamp-conversion-warn t |
627 |
"Warn about soon-to-be-unsupported forms in `time-stamp-format'. |
"Warn about soon-to-be-unsupported forms in `time-stamp-format'. |