Linux, Emacs 27.2

I want in org file to insert current data and time. Now in my machine is 02 June 10:56 AM.

So I use command

C-u C-c .

Here result: enter image description here

Why time is incorrect?

  • Probably nothing to do with org-mode. Do (format-time-string "%c") and (current-time-zone) return the values you expect? – phils Jun 2 at 8:12
  • @phils After set time zone, the problem is gone. (set-time-zone-rule "GMT-3") – a_subscriber Jun 2 at 9:10
  • 1
    I think there's still an issue if the system time zone that Emacs is seeing by default isn't correct. I wouldn't expect that users should need to call set-time-zone-rule, but if you do then the docstring indicates that you should probably prefer (setenv "TZ" "GMT-3"). – phils Jun 2 at 10:40
  • 2
    And perhaps better than that would be to set TZ in the environment that Emacs inherits in the first place, if the default behaviour is wrong, as it might be more than just Emacs defaulting to the wrong zone. A bit of reading suggests that this is getting into system-specific territory though, so you'll need to follow up on the details yourself. – phils Jun 2 at 10:54

Your Answer

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

Browse other questions tagged or ask your own question.