From 34ec3104f77222164e3ef970c9834d149653b880 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 28 Sep 2020 00:02:40 +0100 Subject: [PATCH] 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. --- emacs/.emacs.d/wpc/wpc-misc.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs/.emacs.d/wpc/wpc-misc.el b/emacs/.emacs.d/wpc/wpc-misc.el index de90a751c..3ac46de7f 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