Last active
February 27, 2021 19:12
-
-
Save mnuessler/e1036908ef313a3a6ad7701765f71d7d to your computer and use it in GitHub Desktop.
Emacs Lisp interactive function that prompts for a unix epoch time stamp and converts it into a human readable date.
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
(defun unix-timestamp-to-date () | |
"Prompts for a unix epoch time stamp and converts it to a human-readable date" | |
(interactive) | |
(let* ((time-zone "UTC") | |
(time-unix (seconds-to-time (read-number "Unix epoch time stamp: "))) | |
(time-str (format-time-string "<%Y-%m-%d %a %H:%M:%S>" time-unix time-zone))) | |
(message "Date: %s (%s)" time-str time-zone))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment