help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Printing current time using characters


From: Heime
Subject: Printing current time using characters
Date: Sun, 04 Dec 2022 03:11:10 +0000

I would like to get the time, then insert the equivalent using characters.

Suppose the time is 14:42:17, I want to have the following

H_H_              ; Hours (12 hours)
M_M_M_M_M_M_M_M_  ; Minutes in 5 minute steps
M_M_              ; Minutes on remainder
S_S_S_            ; Seconds in 5 second steps
S_S_              ; Seconds on remainder

I have the following three functions to print "H_", "M_" and "S_".

(defun ticker-hour ()
  "TODO."
  (interactive)
  (insert (propertize "H"
             'font-lock-face '(:background "red"
                               :foreground "white")))
  (insert "_"))

and the same for minutes and seconds using the two corresponding functions
"ticker-minute" and "ticker-second".








reply via email to

[Prev in Thread] Current Thread [Next in Thread]