From 476f696af8921c4906525b46f4cc2928462313a2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 26 Apr 2021 15:26:32 -0500 Subject: Add `acdw/insert-iso-date' Like `crux-insert-date', but I use ISO 8601. --- lisp/acdw.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 9426117..96b69f9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -169,6 +169,12 @@ Prompt only if there are unsaved changes." (16 (mapc 'kill-buffer (delq (current-buffer) (buffer-list))) (delete-other-windows)))) +(defun acdw/insert-iso-date (with-time) + "Insert the ISO-8601-formatted date, with optional time." + (interactive "P") + (let ((format (if with-time "%FT%T%z" "%F"))) + (insert (format-time-string format (current-time))))) + ;; Make `C-z' more useful (defvar acdw/leader -- cgit 1.4.1-21-gabe81