diff options
author | Sean Allred <code@seanallred.com> | 2014-11-14 17:25:27 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-14 17:30:21 -0500 |
commit | 1e859ea6d9b5365f69f8dea5d690e6bee8350e7a (patch) | |
tree | 7f7da64a833f8c1c783b6d4977fc79f06d227d1d /sx-time.el | |
parent | 403c021d92bb036be5d95735bc1403056db3780b (diff) | |
parent | 22cc1b1b959761cda2ff2048dbaeba99cc094930 (diff) |
Merge branch 'master' into network-list
Conflicts:
sx-filter.el
sx-question.el
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 |