(defun insert-date (prefix) "Insert the current date. With prefix-argument, use ISO format. With two prefix arguments, write out the day and month name." (interactive "P") (let ((format (cond ((not prefix) "%d.%m.%Y") ((equal prefix '(4)) "%Y-%m-%d") ((equal prefix '(16)) "%A, %d. %B %Y"))) (system-time-locale "de_DE")) (insert (format-time-string format)))) (global-set-key (kbd "C-c d") 'insert-date)