Function: htz:time-parse

htz:time-parse is a byte-compiled function defined in htz.el.

Signature

(htz:time-parse TIME)

Documentation

Parse TIME (HH:MM:SS) and return a vector [hour minute second].

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/htz.el
(defun htz:time-parse (time)
  "Parse TIME (HH:MM:SS) and return a vector [hour minute second]."
  (let ((time (or time ""))
	(hour nil)
	(minute nil)
	(second nil))
    (cond ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)\\'" time)
	   ;; HH:MM:SS
	   (setq hour 1 minute 2 second 3))
	  ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\)\\'" time)
	   ;; HH:MM
	   (setq hour 1 minute 2 second nil)))
    ;; Return [hour minute second]
    (vector
     (if hour
	 ;; Remove possible 3rd digit in hour to handle prior error in
	 ;; generating hours fixed on 2019-06-10; 3rd digit
	 ;; removed in htz:time-make-string and here.
	 (format "%02.2s" (substring time (match-beginning hour) (match-end hour))) "0")
     (if minute
	 (substring time (match-beginning minute) (match-end minute)) "0")
     (if second
	 (substring time (match-beginning second) (match-end second)) "0"))))