From e84d46099500cc08c2accc8228a24062da680867 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 8 Jun 2014 15:01:49 +0100 Subject: Emacs: Add command to insert date and time --- tag-emacs/emacs.d/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tag-emacs') diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el index 176d6ee8..5babb056 100644 --- a/tag-emacs/emacs.d/init.el +++ b/tag-emacs/emacs.d/init.el @@ -220,6 +220,14 @@ ((equal prefix '(16)) "%A, %d %B %Y")))) (insert (format-time-string format)))) +(defun insert-datetime (prefix) + "Insert the currrent date and time." + (interactive "P") + (let ((format (cond + ((not prefix) "%Y-%m-%d %H:%M:%S") + ((equal prefix '(4)) "%Y-%m-%dT%H:%M:%SZ")))) + (insert (format-time-string format)))) + ;;;; Directory browsing (req-package dired :config (progn -- cgit 1.4.1