Function: org-current-time

org-current-time is a byte-compiled function defined in org.el.gz.

Signature

(org-current-time &optional ROUNDING-MINUTES PAST)

Documentation

Current time, possibly rounded to ROUNDING-MINUTES.

When ROUNDING-MINUTES is not an integer, fall back on the car of org-timestamp-rounding-minutes. When PAST is non-nil, ensure the rounding returns a past time.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-current-time (&optional rounding-minutes past)
  "Current time, possibly rounded to ROUNDING-MINUTES.
When ROUNDING-MINUTES is not an integer, fall back on the car of
`org-timestamp-rounding-minutes'.  When PAST is non-nil, ensure
the rounding returns a past time."
  (let ((r (or (and (integerp rounding-minutes) rounding-minutes)
	       (car org-timestamp-rounding-minutes)))
	(now (current-time)))
    (if (< r 1)
	now
      (let* ((time (decode-time now))
	     (res (org-encode-time
                   (apply #'list
                          0 (* r (round (nth 1 time) r))
                          (nthcdr 2 time)))))
	(if (or (not past) (time-less-p res now))
	    res
	  (time-subtract res (* r 60)))))))