Convert a time zone to a UTC offset string.
(time-zone-to-utc-string zone) → *
See get-decoded-time$ for a description of time zone values.
Function:
(defun time-zone-to-utc-string (zone) (declare (xargs :guard (rationalp zone))) (declare (xargs :split-types t) (type rational zone)) (let ((__function__ 'time-zone-to-utc-string)) (declare (ignorable __function__)) (let* ((sign (if (<= zone 0) "+" "-")) (total-minutes (abs (floor (* zone 60) 1))) (hours (floor total-minutes 60)) (minutes (mod total-minutes 60))) (cat "UTC" sign (natstr (floor hours 10)) (natstr (mod hours 10)) ":" (natstr (floor minutes 10)) (natstr (mod minutes 10))))))