Function: htz:date-arpa
htz:date-arpa is a byte-compiled function defined in htz.el.
Signature
(htz:date-arpa &optional DATE LOCAL TIMEZONE)
Documentation
Convert optional DATE or current date to an arpanet standard date.
Optional 1st argument LOCAL specifies the default local timezone of the DATE. Optional 2nd argument TIMEZONE specifies a timezone to be represented in.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/htz.el
;;; ************************************************************************
;;; Public functions
;;; ************************************************************************
(defun htz:date-arpa (&optional date local timezone)
"Convert optional DATE or current date to an arpanet standard date.
Optional 1st argument LOCAL specifies the default local timezone of the DATE.
Optional 2nd argument TIMEZONE specifies a timezone to be represented in."
(or (vectorp date)
(setq date (htz:date-parse (or date (current-time-string)))))
(let* ((year (string-to-number (aref date 0)))
(month (string-to-number (aref date 1)))
(day (string-to-number (aref date 2)))
(time (htz:time-parse (aref date 3)))
(hour (string-to-number (aref time 0)))
(minute (string-to-number (aref time 1)))
(second (string-to-number (aref time 2)))
(local (or (aref date 4) local htz:local)) ;Use original if defined
(timezone (or timezone local))
(diff (- (htz:zone-to-hour timezone)
(htz:zone-to-hour local)))
(new (htz:time-fix year month day
(+ hour diff) minute second)))
(htz:date-make-arpa (aref new 0) (aref new 1) (aref new 2)
(htz:time-make-string
(aref new 3) (aref new 4) (aref new 5))
timezone)))