Add util function to translate a unix timestamp

This commit is contained in:
Jeremy Dormitzer 2022-09-06 12:14:28 -04:00
parent 3654e83a40
commit 58da56006c
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,8 @@
;; -*- lexical-binding: t; -*-
(defun unix-time-to-string (epoch-seconds &optional format-string)
"Converts an epoch timestamp into a human-readable string."
(interactive "sUnix timestamp: ")
(let ((format-string (or format-string "%FT%T%z")))
(format-time-string format-string epoch-seconds)))
(provide 'init-utils)

View File

@ -71,6 +71,7 @@
(require 'init-org)
(require 'init-profiler)
(require 'init-built-ins)
(require 'init-utils)
(require 'init-dashboard)
(require 'init-dotfiles)
(require 'init-buffers)