Function: htz:date-unix
htz:date-unix is a byte-compiled function defined in htz.el.
Signature
(htz:date-unix &optional DATE LOCAL TIMEZONE)
Documentation
Convert DATE or current date to a unix standard date.
Optional 1st argument LOCAL specifies the local timezone of the DATE (default is the timezone embedded in the date or if there is none, then the value of htz:local). Optional 2nd argument TIMEZONE specifies the timezone in which the date is returned; it defaults to the value of htz:local.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/htz.el
(defun htz:date-unix (&optional date local timezone)
"Convert DATE or current date to a unix standard date.
Optional 1st argument LOCAL specifies the local timezone of the DATE (default
is the timezone embedded in the date or if there is none, then the value of
`htz:local'). Optional 2nd argument TIMEZONE specifies the timezone in which
the date is returned; it defaults to the value of `htz:local'."
(or (vectorp date)
(setq date (htz:date-parse (or date (current-time-string)))))
(or local (setq local (or (aref date 4) htz:local)))
(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)))
(timezone (or timezone local))
(diff (- (htz:zone-to-hour timezone)
(htz:zone-to-hour local)))
(fixed (htz:time-fix year month day
(+ hour diff) minute second)))
(htz:date-make-unix
(aref fixed 0) (aref fixed 1) (aref fixed 2)
(htz:time-make-string (aref fixed 3) (aref fixed 4) (aref fixed 5))
timezone)))