summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2023-10-14 23:47:27 -0400
committerSacha Chua <sacha@sachachua.com>2023-10-14 23:47:27 -0400
commit01a3f66761c1a0ba83f31af7944fe9a3f6048bbb (patch)
tree2567c2fbc9edb188c4a97374f023048fce3580b2
parentf600a88cc67d09a9a45c003ee0d31ed55e194215 (diff)
downloademacsconf-el-01a3f66761c1a0ba83f31af7944fe9a3f6048bbb.tar.xz
emacsconf-el-01a3f66761c1a0ba83f31af7944fe9a3f6048bbb.zip
convert to timezone
-rw-r--r--emacsconf.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/emacsconf.el b/emacsconf.el
index c44ec89..3d3dc6f 100644
--- a/emacsconf.el
+++ b/emacsconf.el
@@ -1067,6 +1067,31 @@ The subheading should match `emacsconf-abstract-heading-regexp'."
time
emacsconf-timezone))))
+(defun emacsconf-convert-to-timezone (timezone time)
+ (interactive (list (progn
+ (require 'tzc)
+ (if (and (derived-mode-p 'org-mode)
+ (org-entry-get (point) "TIMEZONE"))
+ (completing-read (format "To zone (%s): "
+ (org-entry-get (point) "TIMEZONE"))
+ tzc-time-zones nil nil nil nil
+ (org-entry-get (point) "TIMEZONE"))
+ (completing-read "To zone: " tzc-time-zones nil t)))
+ (read-string "Time: ")))
+ (let* ((time
+ (date-to-time
+ (concat emacsconf-date "T" (string-pad time 5 ?0 t) ":00.000"
+ emacsconf-timezone-offset))))
+ (message "%s = %s"
+ (format-time-string
+ "%b %d %H:%M %z"
+ time
+ emacsconf-timezone)
+ (format-time-string
+ "%b %d %H:%M %z"
+ time
+ timezone))))
+
(defun emacsconf-timezone-set (timezone)
"Set the timezone for the current Org entry."
(interactive