From b1e358f247714970ff0823455c81b16fd2a1a994 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 16 Jun 2020 11:46:17 +0100 Subject: Use dot-time format for modeline timestamp My current understanding of how computers deal with time: - Modelling time is easy: use the number of seconds that have elapsed since the Unix epoch. - Display time is complicated. Which timezone should we use? Which format string? --- emacs/.emacs.d/wpc/wpc-misc.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/wpc/wpc-misc.el b/emacs/.emacs.d/wpc/wpc-misc.el index f3fe05719770..1483c53af244 100644 --- a/emacs/.emacs.d/wpc/wpc-misc.el +++ b/emacs/.emacs.d/wpc/wpc-misc.el @@ -6,10 +6,18 @@ ;;; Code: -;; Display time in the modeline -;; TODO: Save preferred date format strings and cycle through them since I waver -;; about which is my favorite. -(setq display-time-format "%R %a %d %b [%U of 52 weeks]") +;; I'm borrowing from the dot-time format (i.e. https://dotti.me) to encode the +;; timestamp. This displays the UTC time and an offset to show the number of +;; hours East or West of UTC my current timezone is using `current-time-zone'. +;; +;; Reminder to me: +;; 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 [%U of 52 weeks]")) (display-time-mode 1) ;; disable custom variable entries from being written to ~/.emacs.d/init.el -- cgit 1.4.1