Skip to content

Instantly share code, notes, and snippets.

@cabo
Created January 8, 2016 12:04
Show Gist options
  • Save cabo/cb56cb935ba868f169f3 to your computer and use it in GitHub Desktop.
Save cabo/cb56cb935ba868f169f3 to your computer and use it in GitHub Desktop.
Insert time in emacs
(defun german-time ()
(format-time-string "%d.%m.%Y" (current-time)))
(defun iso-date ()
(format-time-string "%Y-%m-%d" (current-time)))
(defun ins-time (&optional arg)
(interactive "*P")
(if arg
(insert (german-time))
(insert (iso-date))))
(global-set-key "\C-c=" (quote ins-time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment