diff options
| author | Jakob L. Kreuze | 2019-07-20 16:57:55 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2019-07-20 16:57:55 -0400 |
| commit | 9ce3904338a911547ddddf328f5efc077983ace9 (patch) | |
| tree | b08fdf6ef393a9125a4acf1fdd75a2c5a2e63e5b | |
| parent | c45db4c75b221b7bf19b8d47dbcaa0a5b531bed8 (diff) | |
Add a convenience function for creating ISO 8601 timestamps
| -rw-r--r-- | jakob.org | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -346,6 +346,23 @@ at a time instead, which is sometimes useful when perusing IRC logs. (bind-key "<prior>" #'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 |