diff options
author | EmacsConf Organizers <orga@front0.emacsconf.org> | 2022-10-08 14:32:44 +0000 |
---|---|---|
committer | EmacsConf Organizers <orga@front0.emacsconf.org> | 2022-10-08 14:32:44 +0000 |
commit | 49cdc0047fbe0119bb197724bd5cb9dbfeda7132 (patch) | |
tree | 39c558accc3622c9d5f155f8621522f89e36cca0 /emacsconf.el | |
parent | 028b3db31447476e5636d5017997d520e9664a66 (diff) | |
download | emacsconf-el-49cdc0047fbe0119bb197724bd5cb9dbfeda7132.tar.xz emacsconf-el-49cdc0047fbe0119bb197724bd5cb9dbfeda7132.zip |
Work with different system timezone
Diffstat (limited to 'emacsconf.el')
-rw-r--r-- | emacsconf.el | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/emacsconf.el b/emacsconf.el index a5ba782..ddcee94 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -255,16 +255,24 @@ (expand-file-name "captions" (expand-file-name emacsconf-year emacsconf-directory))) :conf-year emacsconf-year :start-time (when (org-entry-get (point) "SCHEDULED") - (org-timestamp-to-time - (org-timestamp-split-range - (org-timestamp-from-string - (org-entry-get (point) "SCHEDULED"))))) + (date-to-time + (concat + (format-time-string "%Y-%m-%dT%H:%M:%S" + (org-timestamp-to-time + (org-timestamp-split-range + (org-timestamp-from-string + (org-entry-get (point) "SCHEDULED"))))) + emacsconf-timezone-offset))) :end-time (when (org-entry-get (point) "SCHEDULED") - (org-timestamp-to-time - (org-timestamp-split-range - (org-timestamp-from-string - (org-entry-get (point) "SCHEDULED")) - t)))) + (date-to-time + (concat + (format-time-string "%Y-%m-%dT%H:%M:%S" + (org-timestamp-to-time + (org-timestamp-split-range + (org-timestamp-from-string + (org-entry-get (point) "SCHEDULED")) + t))) + emacsconf-timezone-offset)))) (let* ((entry-props (org-entry-properties))) (mapcar (lambda (o) (list (car o) (assoc-default (cadr o) entry-props))) @@ -650,6 +658,10 @@ Include some other things, too, such as emacsconf-year, title, name, email, url, ;; Timezones (defvar emacsconf-date "2022-12-03" "Starting date of EmacsConf.") +(defvar emacsconf-timezone-offset + (format-time-string "%z" (date-to-time emacsconf-date) emacsconf-timezone) + "Timezone offset for `emacsconf-timezone' on `emacsconf-date'.") + (defun emacsconf-convert-from-timezone (timezone time) (interactive (list (completing-read "From zone: " tzc-time-zones) (read-string "Time: "))) |