From 9ce3904338a911547ddddf328f5efc077983ace9 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Sat, 20 Jul 2019 16:57:55 -0400 Subject: Add a convenience function for creating ISO 8601 timestamps --- jakob.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/jakob.org b/jakob.org index b8637d6..ab244c3 100644 --- a/jakob.org +++ b/jakob.org @@ -346,6 +346,23 @@ at a time instead, which is sometimes useful when perusing IRC logs. (bind-key "" #'scroll-down-line) #+END_SRC +Convenience function for inserting an ISO 8601 timestamp or copying it to the +kill ring. + +#+BEGIN_SRC elisp +(defun insert-isodate (arg) + "Insert the current time as an ISO 8601 timestamp. If ARG is +non-nil, do not insert the timestamp, but push it to the +beginning of the kill ring." + (interactive "P") + (let ((timestamp (format-time-string "%Y-%m-%dT%H:%M:%S%z"))) + (if arg + (kill-new timestamp) + (insert timestamp)))) + +(bind-key "C-x M-d" #'insert-isodate) +#+END_SRC + ** Ivy As [[https://icosahedron.website/@zge/101330910258980695][suggested by a friend]], I tried out Ivy as a replacement for ido. It was love -- cgit v1.3