C-u C-c ! generates a time stamp like [2015-05-04 Mon 17:13]
I would like to assign a shortcut (e.g F1) to this action.
So far I have:
(defun my/timenow (&optional arg)
(interactive)
(let ((current-prefix-arg 4)) ;; emulate C-u
(org-time-stamp arg 'inactive)
)
)
But this prompts me for the time and I have to press RET to insert it.
How can I insert the inactive timestamp without any prompts at all?
(insert (org-time-stamp '(16) t))
inserts two timestamps next to each other. Do you know why? – miguelmorin Oct 15 '18 at 15:42org-time-stamp
code (use M-x find-function), it's inserting by itself, so you don't need extrainsert
. Alternatively, you can useinsert
with a combination offormat-time-string
andorg-time-stamp-format
. – karlicoss Feb 15 '19 at 23:37org-time-stamp
requires an argument to be called since it's(defun org-time-stamp (arg &optional inactive) ...)
. I wonder what argument is actually passed in when you pressC-c .
. I was not able to simulate that programatically. – xji Mar 26 '20 at 09:46