Function: org-timestamp-from-time

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

Signature

(org-timestamp-from-time TIME &optional WITH-TIME INACTIVE)

Documentation

Convert a time value into a timestamp object.

TIME is an Emacs internal time representation, as returned, e.g., by current-time.

When optional argument WITH-TIME is non-nil, return a timestamp object with a time part, i.e., with hours and minutes.

Return an inactive timestamp if INACTIVE is non-nil. Otherwise, return an active timestamp.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-timestamp-from-time (time &optional with-time inactive)
  "Convert a time value into a timestamp object.

TIME is an Emacs internal time representation, as returned, e.g.,
by `current-time'.

When optional argument WITH-TIME is non-nil, return a timestamp
object with a time part, i.e., with hours and minutes.

Return an inactive timestamp if INACTIVE is non-nil.  Otherwise,
return an active timestamp."
  (pcase-let ((`(,_ ,minute ,hour ,day ,month ,year . ,_) (decode-time time)))
    (org-element-create 'timestamp
			(list :type (if inactive 'inactive 'active)
			      :year-start year
			      :month-start month
			      :day-start day
			      :hour-start (and with-time hour)
			      :minute-start (and with-time minute)))))