about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-09-27T23·02+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-09-27T23·02+0100
commit34ec3104f77222164e3ef970c9834d149653b880 (patch)
tree2079bf11b9b2c090c16f16eab8f240e63670bc44
parent1ad6c30accf44671e0257a71f8302d8c268e308d (diff)
Debug dottime in modeline
My modeline was displaying the local time (not UTC time) and appending the UTC
timezone offset, which was confusing me.

When it was `00:03` in London, my modeline would read `00:03+01`. One way of
interpreting this is that it's `00:03` in London and the `+01` is a reminder
that I'm one hour ahead of UTC. However, I was reading it as though it was
`00:03` UTC and thus `01:03` in London.

I had to set `display-time-string-forms` instead of `display-time-string` to
pass the `t` argument to the `ZONE` parameter to indicate that I'd prefer to use
UTC time and not local time when expanding the variables.
-rw-r--r--emacs/.emacs.d/wpc/wpc-misc.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/emacs/.emacs.d/wpc/wpc-misc.el b/emacs/.emacs.d/wpc/wpc-misc.el
index de90a751c4ea..3ac46de7f9d8 100644
--- a/emacs/.emacs.d/wpc/wpc-misc.el
+++ b/emacs/.emacs.d/wpc/wpc-misc.el
@@ -33,10 +33,11 @@
 ;; LON: +00 (UTC) or +01 (BST)
 ;; NYC: -05
 ;; SF:  -07
-(setq display-time-format
-      (concat "%H·%M"
-              (format "%0+3d" (/ (car (current-time-zone)) 3600))
-              " %a %d %b"))
+(setq display-time-string-forms
+      '((format-time-string
+         (concat "%H·%M"
+                 (format "%0+3d" (/ (car (current-time-zone)) 3600))
+                 " %a %d %b") nil t)))
 (display-time-mode 1)
 
 ;; Remove the boilerplate in the *scratch* buffer