emacs中插入当前时间是可以自定义格式的,方法如下:

1
2
3
(defun insert-current-time ()
  (interactive)
  (insert (format-time-string "%Y-%m-%d %H:%M:%S" (current-time))))