Function: icalendar-read-time

icalendar-read-time is a byte-compiled function defined in icalendar-parser.el.gz.

Signature

(icalendar-read-time S)

Documentation

Read an icalendar-time from a string S.

S should be a match against rx icalendar-time.

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/icalendar-parser.el.gz
(cl-deftype ical:numeric-second () '(integer 0 60)) ; 60 represents a leap second

(defun ical:read-time (s)
  "Read an `icalendar-time' from a string S.
S should be a match against rx `icalendar-time'."
  (require 'icalendar-utils) ; for ical:make-date-time; avoids circular require
  (declare-function ical:make-date-time "icalendar-utils")
  (let ((hour (string-to-number (substring s 0 2)))
        (minute (string-to-number (substring s 2 4)))
        (second (string-to-number (substring s 4 6)))
        (utcoffset (if (and (length= s 7)
                            (equal "Z" (substring s 6 7)))
                       t ; UTC
                     ;; unknown/'floating' time zone:
                     nil)))
    (ical:make-date-time :second second
                         :minute minute
                         :hour hour
                         :zone utcoffset)))