Function: org-timestamp-translate

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

Signature

(org-timestamp-translate TIMESTAMP &optional BOUNDARY)

Documentation

Translate TIMESTAMP object to custom format.

Format string is defined in org-timestamp-custom-formats, which see.

When optional argument BOUNDARY is non-nil, it is either the symbol start or end. In this case, only translate the starting or ending part of TIMESTAMP if it is a date or time range. Otherwise, translate both parts.

Return timestamp as-is if org-display-custom-times is nil or if it has a diary type.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-timestamp-translate (timestamp &optional boundary)
  "Translate TIMESTAMP object to custom format.

Format string is defined in `org-timestamp-custom-formats',
which see.

When optional argument BOUNDARY is non-nil, it is either the
symbol `start' or `end'.  In this case, only translate the
starting or ending part of TIMESTAMP if it is a date or time
range.  Otherwise, translate both parts.

Return timestamp as-is if `org-display-custom-times' is nil or if
it has a `diary' type."
  (let ((type (org-element-property :type timestamp)))
    (if (or (not org-display-custom-times) (eq type 'diary))
	(org-element-interpret-data timestamp)
      (let ((fmt (org-time-stamp-format
                  (org-timestamp-has-time-p timestamp) nil 'custom)))
	(if (and (not boundary) (memq type '(active-range inactive-range)))
	    (concat (org-format-timestamp timestamp fmt)
		    "--"
		    (org-format-timestamp timestamp fmt t))
	  (org-format-timestamp timestamp fmt (eq boundary 'end)))))))