diff options
author | Sean Allred <code@seanallred.com> | 2014-11-14 09:34:14 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-14 09:34:14 -0500 |
commit | 77e519de7b1219767a25399b727c2aece6189e6c (patch) | |
tree | 5c99eb09549561a549e93c19aaa788cd81a16073 /sx-time.el | |
parent | 525a304f9aca38e1101a1d02ade26ec3b8e91b23 (diff) | |
parent | 8d14a6b425d27b7b942f3922d583877ec8b00690 (diff) |
Merge pull request #46 from vermiculus/sx-question-mode
Question Mode
Diffstat (limited to 'sx-time.el')
-rw-r--r-- | sx-time.el | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -49,5 +49,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 |