Created
December 8, 2016 04:18
-
-
Save deadghost/786816bc119cbc88aacf0e662bbc10af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar current-date-time-format "%a %b %d %H:%M:%S %Z %Y" | |
"Format of date to insert with `insert-current-date-time' func | |
See help of `format-time-string' for possible replacements") | |
(defvar current-time-format "%a %H:%M:%S" | |
"Format of date to insert with `insert-current-time' func. | |
Note the weekly scope of the command's precision.") | |
(defun insert-current-date-time () | |
"insert the current date and time into current buffer. | |
Uses `current-date-time-format' for the formatting the date/time." | |
(interactive) | |
;; (insert "==========\n") | |
;; (insert (let () (comment-start))) | |
(insert (format-time-string current-date-time-format (current-time))) | |
(insert "\n")) | |
(defun insert-current-time () | |
"insert the current time (1-week scope) into the current buffer." | |
(interactive) | |
(insert (format-time-string current-time-format (current-time))) | |
(insert "\n")) | |
(global-set-key (kbd "<f5>") 'insert-current-date-time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment