1

When loading a .log file I get the message

Warning (emacs): Failed to determine system timezone; consider customizing ‘datetime-timezone’ variable

Going to the customization menu, the options are not evident:

Hide Datetime Timezone: nil
    State : STANDARD.
   Default timezone for date-time formatting and parsing. Hide
   Leave unset to let the library auto-determine it from your OS
   when necessary.
Groups: Datetime

Lines that also appear in the source

(defcustom datetime-timezone nil
  "Default timezone for date-time formatting and parsing.
Leave unset to let the library auto-determine it from your OS
when necessary."
  :group 'datetime
  :type  'symbol)
  1. What is the appropriate way to set my timezone on macOS so that datetime-timezone would inherit it without a duplication in ~/.emacs.
  2. Failing that, what is the format for this customization? (For some reason, C-h i does not include a menu for datetime in my installation.)
0

According to the documentation it should be determined with the TZ environment variable :

The default time zone is determined by the TZ environment variable. [...] For example, you can tell Emacs to default to Universal Time with (setenv "TZ" "UTC0"). If TZ is not in the environment, Emacs uses system wall clock time, which is a platform-dependent default time zone.

Have you tried to set this variable ?

You should be able to set it from Emacs, using eval-expression (M-:) :

(setenv "TZ" "America/New_York")

or you can set it at launch before running emacs command from your shell :

$ TZ="America/New_York" emacs

Tested successfully on Linux, but can't tell for Mac OS.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Can you add the relevant part from documentation to your post, as well as an example that works as expected? – DoMiNeLa10 May 9 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.