From 49cdc0047fbe0119bb197724bd5cb9dbfeda7132 Mon Sep 17 00:00:00 2001 From: EmacsConf Organizers Date: Sat, 8 Oct 2022 14:32:44 +0000 Subject: Work with different system timezone --- emacsconf.el | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'emacsconf.el') 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: "))) -- cgit v1.2.3