all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* time-stamp problem
@ 2004-12-02 16:57 Sebastian Luque
  2004-12-02 18:02 ` Kevin Rodgers
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Luque @ 2004-12-02 16:57 UTC (permalink / raw)


After having solved a problem with the output from my system's 'date', I come
across another one with the time-stamp function. I was hoping to find help in
the library itself, but time-stamp is already compiled in my system (GNU
Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2004-10-16
on raven, modified by Debian). The problem is that timestamps ignore my
timezone adjustment completely, so it shows GMT time. The curious thing is
that everywhere else (including any shell outside of Emacs, the Emacs
modeline, and calls to 'date' within Emacs) I have the correct time, so I
don't where time-stamp is getting its value from. Any help please?

Thank you.
-- 
Best wishes,
Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: time-stamp problem
  2004-12-02 16:57 time-stamp problem Sebastian Luque
@ 2004-12-02 18:02 ` Kevin Rodgers
  2004-12-02 21:16   ` Sebastian Luque
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2004-12-02 18:02 UTC (permalink / raw)


Sebastian Luque wrote:
 > After having solved a problem with the output from my system's 
'date', I come
 > across another one with the time-stamp function. I was hoping to find 
help in
 > the library itself, but time-stamp is already compiled in my system (GNU
 > Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 
2004-10-16
 > on raven, modified by Debian). The problem is that timestamps ignore my
 > timezone adjustment completely, so it shows GMT time. The curious 
thing is
 > that everywhere else (including any shell outside of Emacs, the Emacs
 > modeline, and calls to 'date' within Emacs) I have the correct time, so I
 > don't where time-stamp is getting its value from. Any help please?

,----[ C-h v time-stamp-time-zone RET ]
| time-stamp-time-zone's value is nil
|
| Documentation:
| If non-nil, a string naming the timezone to be used by M-x time-stamp.
| Format is the same as that used by the environment variable TZ on your 
system.
|
| You can customize this variable.
|
| Defined in `time-stamp'.
`----

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: time-stamp problem
  2004-12-02 18:02 ` Kevin Rodgers
@ 2004-12-02 21:16   ` Sebastian Luque
  2004-12-03 18:10     ` nick
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Luque @ 2004-12-02 21:16 UTC (permalink / raw)


Hi Kevin,

Kevin Rodgers wrote:

> ,----[ C-h v time-stamp-time-zone RET ]
> | time-stamp-time-zone's value is nil
> |
> | Documentation:
> | If non-nil, a string naming the timezone to be used by M-x time-stamp.
> | Format is the same as that used by the environment variable TZ on your
> system.
> |
> | You can customize this variable.
> |
> | Defined in `time-stamp'.

I forgot to mention that I did set this to my local timezone ("CST", Central
Standard Time, -0600). FWIW, working with html-helper-mode, my html files get
time-stamped correctly. So both time-stamp and html-helper-mode write the
correct timezone string (CST), but time-stamp ignores the offset completely,
so it's showing GMT time (i.e. local CST time + 0600). Very strange. What can
be going on?


-- 
Best wishes,
Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: time-stamp problem
  2004-12-02 21:16   ` Sebastian Luque
@ 2004-12-03 18:10     ` nick
  2004-12-04  0:41       ` Sebastian Luque
  0 siblings, 1 reply; 5+ messages in thread
From: nick @ 2004-12-03 18:10 UTC (permalink / raw)


Sebastian Luque <sluque@mun.ca> writes:

> Kevin Rodgers wrote:
>
>> ,----[ C-h v time-stamp-time-zone RET ]
>> | time-stamp-time-zone's value is nil
>> ...
>
> I forgot to mention that I did set this to my local timezone ("CST", Central
> Standard Time, -0600). FWIW, working with html-helper-mode, my html files get
> time-stamped correctly. So both time-stamp and html-helper-mode write the
> correct timezone string (CST), but time-stamp ignores the offset completely,
> so it's showing GMT time (i.e. local CST time + 0600). Very strange. What can
> be going on?

Does it help to set this variable to nil and to unset the TZ
environment variable?

It is probably the case that setting these to "CST" does not work
because there is no "CST" timezone defined on your system, so it punts
and uses UTC for the time. E.g. on my system, the timezone info directory
(/usr/share/zoneinfo - yours might be in a different place) does not
contain a CST file; on the other hand, it does have a CST6CDT file and
things seem to work if I set TZ to "CST6CDT". But I find it much more
convenient to forego explicit settings of environment variables: I
just make a symlink /etc/localtime to point to the correct timezone
file:

$ ls -l /etc/localtime
lrwxrwxrwx ... /etc/localtime -> /usr/share/zoneinfo/US/Eastern

and everything just works (as long as /usr is mounted).

-- 
nick  (nicholas dot dokos at hp dot com)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: time-stamp problem
  2004-12-03 18:10     ` nick
@ 2004-12-04  0:41       ` Sebastian Luque
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Luque @ 2004-12-04  0:41 UTC (permalink / raw)


Hi,

This turned out to be a lot more complex and confusing than I thought. I seem
to have magically solved the problem by setting time-stamp-time-zone to nil
(yes, that's right!) but leaving time-stamp-format set to:

%3a, %02d %3b %:y, at %02H:%02M:%02S %Z

The last %Z stands for the timezone. With this, time-stamp is stamping files
with the correct time AND my correct timezone string! I don't have the TZ
variable set in my environment, so I have no idea where in the world
time-stamp is getting its timezone string from. So the problem is solved, but
I don't what is going on.

nick wrote:

> It is probably the case that setting these to "CST" does not work
> because there is no "CST" timezone defined on your system, so it punts
> and uses UTC for the time. E.g. on my system, the timezone info directory
> (/usr/share/zoneinfo - yours might be in a different place) does not
> contain a CST file; on the other hand, it does have a CST6CDT file and
> things seem to work if I set TZ to "CST6CDT".

I can see that file, but also a /usr/share/zoneinfo/Canada/Central which is
what I need.

> But I find it much more 
> convenient to forego explicit settings of environment variables: I
> just make a symlink /etc/localtime to point to the correct timezone
> file:
> 
> $ ls -l /etc/localtime
> lrwxrwxrwx ... /etc/localtime -> /usr/share/zoneinfo/US/Eastern
> 
> and everything just works (as long as /usr is mounted).

I tried this at some point before and found that an init script is rewriting
this info at startup. I'm using a hard disk installation of Knoppix and the
only way I could get the timezone info to be permanently set was to
modify /etc/init.d/knoppix-autoconfig in the following lines:

# American version
LANGUAGE="us"
COUNTRY="us"
LANG="C"
KEYTABLE="us"
XKEYBOARD="us"
KDEKEYBOARD="us"
CHARSET="iso8859-1"
# Additional KDE Keyboards
KDEKEYBOARDS="de,fr"
TZ="America/Winnipeg"

Nonetheless, echo $TZ shows nothing in a shell. Does somebody understand this?

Thank you!


-- 
Best wishes,
Sebastian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-12-04  0:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-02 16:57 time-stamp problem Sebastian Luque
2004-12-02 18:02 ` Kevin Rodgers
2004-12-02 21:16   ` Sebastian Luque
2004-12-03 18:10     ` nick
2004-12-04  0:41       ` Sebastian Luque

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.