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

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

Re: date discrepancies


From: Pascal Bourguignon
Subject: Re: date discrepancies
Date: 02 Sep 2004 07:04:04 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Sebastian Luque <sluque@mun.ca> writes:

> Dear List,
> 
> I've discovered something I can't explain and correct. Whenever I type:
> 
> M-! date
> 
> to send the date command to the shell, I get a different time and time zone 
> that I get from running the command on a standard bash shell. I have set my 
> clock to Central Daylight Savings Time, and this is what I get from the 
> standard bash shell, but when running the command from within Emacs, I get 
> the corresponding Eastern Daylight Savings Time. Would somebody please 
> explain what is going on and how can this be fixed? Thanks in advance.

It depends on how you launch emacs, therefore what environment
variables are present.  The zone is determined by the variable TZ, or
if absent, by the file /etc/locatime.

To see the time zone in emacs, type in *scratch*:  (getenv "TZ") C-u C-x C-e
To see it in shell, type: echo $TZ
Try it in a shell on xterm and in a shell on emacs: M-x shell RET echo $TZ RET

You can correct it either by modifying the environment used by the
program that launches emacs, or from emacs using: 

    (setenv "TZ" "CEST") C-x C-e

or inserting: (setenv "TZ" "CEST")
in your ~/.emacs


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.

reply via email to

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