Function: timeclock-seconds-to-string

timeclock-seconds-to-string is a byte-compiled function defined in timeclock.el.gz.

Signature

(timeclock-seconds-to-string SECONDS &optional SHOW-SECONDS REVERSE-LEADER)

Documentation

Convert SECONDS into a compact time string.

If SHOW-SECONDS is non-nil, make the resolution of the return string include the second count. If REVERSE-LEADER is non-nil, it means to output a "+" if the time value is negative, rather than a "-". This is used when negative time values have an inverted meaning (such as with time remaining, where negative time really means overtime).

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/timeclock.el.gz
(defun timeclock-seconds-to-string (seconds &optional show-seconds
					    reverse-leader)
  "Convert SECONDS into a compact time string.
If SHOW-SECONDS is non-nil, make the resolution of the return string
include the second count.  If REVERSE-LEADER is non-nil, it means to
output a \"+\" if the time value is negative, rather than a \"-\".
This is used when negative time values have an inverted meaning (such
as with time remaining, where negative time really means overtime)."
  (let ((s (abs (truncate seconds))))
    (format (if show-seconds "%s%d:%02d:%02d" "%s%d:%02d")
	    (if (< seconds 0) (if reverse-leader "+" "-") "")
	    (/ s 3600) (% (/ s 60) 60) (% s 60))))