The following setting display the date in Gregorian calendar in the mode line.
(setq display-time-day-and-date t)
(display-time)
My question is how to change the above settings for date to be shown in the Julian calendar?
You can compute arbitrary date strings by overriding display-time-string-forms
.
The documentation says this:
List of expressions governing display of the time in the mode line. For most purposes, you can control the time format using `display-time-format' which is a more standard interface.
This expression is a list of expressions that can involve the keywords
load
,day
,month
, andyear
,12-hours
,24-hours
,minutes
,seconds
, all numbers in string form, andmonthname
,dayname
,am-pm
, andtime-zone
all alphabetic strings, andFor example, the form
'((substring year -2) "/" month "/" day " " 24-hours ":" minutes ":" seconds (if time-zone " (") time-zone (if time-zone ")") (if mail " Mail" ""))
would give mode line times like `94/12/30 21:07:48 (UTC)'.
To display the Julian date as provided by calendar
try this:
(require 'calendar)
(setq display-time-string-forms
'((calendar-julian-date-string)))
(display-time)
M-x calendar
then M-x calendar-julian-print-date
.
display-time-string-forms
to call calendar-julian-date-string
on the Gregorian date.
(require 'calendar)
should be added. By the way what is the value now
. When restarting Emacs, the displaying time becomes different. I think without now
it would be fine.
now
has the value of evaluating (current-time)
.
display-time-format
variable help you?