all repos — nixfiles @ e84d46099500cc08c2accc8228a24062da680867

System and user configuration, managed by nix and home-manager

Emacs: Add command to insert date and time

Alan Pearce
commit

e84d46099500cc08c2accc8228a24062da680867

parent

3608af91ffe95569272d655b5fc111de60e446c6

1 file changed, 8 insertions(+), 0 deletions(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -220,6 +220,14 @@ ((equal prefix '(4)) "%d/%m/%Y")
((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