From: ueno Date: Mon, 29 May 2006 01:49:53 +0000 (+0000) Subject: * epa.el (epa--format-seconds): New function. X-Git-Tag: epg-0_0_2~5 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c447878abb1cef760e440afa698f79a4d3c1b272;p=elisp%2Fepg.git * epa.el (epa--format-seconds): New function. (epa-show-key): Convert seconds from epoch to date. --- diff --git a/ChangeLog b/ChangeLog index 6b4f505..2c0ef7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-29 Daiki Ueno + + * epa.el (epa--format-seconds): New function. + (epa-show-key): Convert seconds from epoch to date. + 2006-05-28 Daiki Ueno * epg.el (epg-start-import-keys): Don't specify filename if keys diff --git a/epa.el b/epa.el index 4269254..7596176 100644 --- a/epa.el +++ b/epa.el @@ -401,6 +401,12 @@ If SECRET is non-nil, list secret keys instead of public keys." (delete-window (get-buffer-window epa-keys-buffer))) (kill-buffer epa-keys-buffer)))) +(defun epa--format-seconds (seconds) + (let ((number-seconds (string-to-number (concat seconds ".0")))) + (format-time-string "%Y-%m-%d" + (cons (floor (/ number-seconds 65536)) + (floor (mod number-seconds 65536)))))) + (defun epa-show-key (key) (let* ((primary-sub-key (car (epg-key-sub-key-list key))) (entry (assoc (epg-sub-key-id primary-sub-key) @@ -450,10 +456,11 @@ If SECRET is non-nil, list secret keys instead of public keys." (cdr (assq (epg-sub-key-algorithm (car pointer)) epg-pubkey-algorithm-alist)) "\n\tCreated: " - (epg-sub-key-creation-time (car pointer)) + (epa--format-seconds (epg-sub-key-creation-time (car pointer))) (if (epg-sub-key-expiration-time (car pointer)) - (format "\n\tExpires: %s" (epg-sub-key-expiration-time - (car pointer))) + (format "\n\tExpires: %s" + (epa--format-seconds (epg-sub-key-expiration-time + (car pointer)))) "") "\n\tCapabilities: " (mapconcat #'symbol-name