[英]How to insert current time in the emacs org-mode
有沒有一種簡單的方法可以在組織模式中插入當前時間(如 TIME: [2012-07-02 Mon 16:44])? 手冊中有很多東西(時鍾、截止日期、時間表),但其中大部分都需要手動輸入時間。
Cu Cc.
將在點插入時間戳,盡管 Org 仍會提示您輸入時間(默認為當前時間)。
更多:組織模式手冊中的“創建時間戳” 。
在我的安裝中,是org-mode version 9,下面輸入當前日期和時間,沒有任何提示
C-u C-u C-c .
C-u C-c !
插入帶有當前時間的非活動時間戳,例如:
[2018-05-08 Tue 00:30]
在 emacs-lisp 中,你可以使用
(org-insert-time-stamp (current-time) t)
使用默認設置,它將在格式上生成時間戳
<2021-06-20 Sun 10:33>
如果你想從任何 emacs 會話訪問它,把
(defun insert-now-timestamp()
"Insert org mode timestamp at point with current date and time."
(interactive)
(org-insert-time-stamp (current-time) t))
在你的.emacs
文件中。 然后,您可以使用Mx insert-now-timestamp
調用該函數。
Emacs 27.2,組織模式 9.4.4。
編輯:我現在意識到這與@anachronic 的解決方案做同樣的事情。 但是我把它留在這里供參考。
在我的安裝上
C-u C-c .
插入日期時間戳
只是給你一些其他的選擇:
這兩個選項是非常強大的工具,不僅僅用於插入日期和時間。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.