by nvilcins · 5y ago · 0 comments
(defun mdy ()
(interactive)
(insert (format-time-string "%04Y-%02m-%02d")))
That inserts the "proper" date format (e.g., 2021-11-11) at the current point.Then to create a date-stamped file name:
(defun file-mdy (file-name)
(interactive "sbasename: ")
(find-file (format "%s-%s.org" (format-time-string "%04Y-%02m-%02d") file-name))
(save-buffer))
And a few others.Nobody seems to misunderstand this date format. US folks might find it annoying, but understand what it means.