diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-08 20:11:59 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-08 20:11:59 +0000 |
commit | f411787e513aec449ef87c8e0c6292eb5428dd50 (patch) | |
tree | 349e264f886031a14d4a272cf075313cfcdb4912 | |
parent | b4c5f99a50a61e7642dbe6601ba8da3207d0436e (diff) |
Add date formatting to sx-time
-rw-r--r-- | sx-time.el | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -50,5 +50,27 @@ (concat (format "%.0f" (/ delay (car (cddr here)))) (cadr here))))))) +(defcustom sx-time-date-format-year "%H:%M %e %b %Y" + "Format used for dates on a past year. +See also `sx-time-date-format'." + :type 'string + :group 'sx-time) + +(defcustom sx-time-date-format "%H:%M - %d %b" + "Format used for dates on this year. +See also `sx-time-date-format-year'." + :type 'string + :group 'sx-time) + +(defun sx-time-seconds-to-date (seconds) + "Return the integer SECONDS as a date string." + (let ((time (seconds-to-time seconds))) + (format-time-string + (if (string= (format-time-string "%Y") + (format-time-string "%Y" time)) + sx-time-date-format + sx-time-date-format-year) + time))) + (provide 'sx-time) ;;; sx-time.el ends here |