Function: lm-last-modified-date

lm-last-modified-date is a byte-compiled function defined in lisp-mnt.el.gz.

Signature

(lm-last-modified-date &optional FILE ISO-DATE)

Documentation

Return the modify-date given in file FILE, or current buffer if FILE is nil.

ISO-DATE non-nil means return the date in ISO 8601 format.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/lisp-mnt.el.gz
(defun lm-last-modified-date (&optional file iso-date)
  "Return the modify-date given in file FILE, or current buffer if FILE is nil.
ISO-DATE non-nil means return the date in ISO 8601 format."
  (lm-with-file file
    (when (progn (goto-char (point-min))
		 (re-search-forward
		  "\\$[I]d: [^ ]+ [^ ]+ \\([^/]+\\)/\\([^/]+\\)/\\([^ ]+\\) "
                  (lm-code-start) t))
      (let ((dd (match-string 3))
	    (mm (match-string 2))
	    (yyyy (match-string 1)))
	(if iso-date
	    (format "%s-%s-%s" yyyy mm dd)
	  (format "%s %s %s"
		  dd
		  (nth (string-to-number mm)
		       '("" "Jan" "Feb" "Mar" "Apr" "May" "Jun"
			 "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
		  yyyy))))))