bug-coreutils
[Top][All Lists]
Advanced

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

Re: Can't set the timezone for "date".


From: Alan Mackenzie
Subject: Re: Can't set the timezone for "date".
Date: Sun, 22 Jul 2007 19:29:33 +0000
User-agent: Mutt/1.5.9i

Hi, Bob!

On Sat, Jul 21, 2007 at 12:06:11PM -0600, Bob Proulx wrote:
> Alan Mackenzie wrote:
> > I'm having problems with my date.  My system is basically Debian
> > Sarge GNU/Linux.  uname -a gives this:

> I have an obligatory response that says Etch is now current stable. :-)
> This won't affect your issue though.

I've had one go at installing it.  I've tried one or two other
distributions, too.  I'll upgrade to the right one when I've got a few
spare days.

> > What I would like to see printed is something like this:
> >     Sat Jul 21 14:37:34 GMT 2007
> > , though I'd be happy enough with "UTC" instead of "GMT".

> Set it to UTC and you will see UTC.

> > I'm not aware of exactly what it is on my system that decides to
> > display dates with "BST".  The variable TZ was null.  I have tried
> > setting TZ to "GMT", "UTC", "0000" and even "asdf", none of which
> > makes the slightest difference.  I have tried "set | grep BST".

> GNU libc ships with a script to help set the /etc/timezone file to the
> desired timezone.  When glibc is installed or updated the postinst
> script calls tzconfig and says: "Run 'tzconfig' if you wish to change
> it."

Thanks!  That has worked perfectly.  Problem, though: how should I know
that it exists?  (That's not a rhetorical question by the way.)

>   sudo tzconfig

> > Earlier in the day I had changed my /etc/timezone file from
> > "Europe/London" to "GMT" and rebooted.

> Why did you reboot?

On the off chance that the file was read once at boot-time, rather than
each time "date" is called.  Nothing else was working, I couldn't find
pertinent documentation, I was feeling fed up and useless, so why not try
rebooting?  ;-)

> > This made not a blind bit of difference.

> Since you were editing the file manually try "Etc/GMT" instead of "GMT"
> and it should behave as you expect.  However I suggest using "UTC"
> instead of "GMT", as in "Etc/UTC".

I'll stick with "GMT", I think.  It describes the time zone for what it
is (the local time in a certain English village), rather than the context
in which it it used.  I also like the terms "Prague time" and "St.
Petersburg time", even if I'm the only person in the world who uses them.
;-)

> But actually probably better to run 'tzconfig' to do this for you
> since that will protect against typographic errors.

Done that, it did, and it has worked.  Thanks!

> > Is there some dstardly setting somewhere which I haven't set, and has
> > decided I really want "Summer Time" (aka daylight saving time)?

> This is really a better question for address@hidden than
> bug-coreutils.

Hmm.  That's a strange answer.  I'm interpreting it to mean that "summer
time" is outwith the scope of coreutils.

> > I can't find anything at all int the info file for date,
> > sh-utils.info, "This manual minimally documents version 1.16 of the
> > GNU shell utilities" about setting timezones.  I think this is a bug
> > of omission in the manual.  

> That manual should not exist on a Sarge system.  That is the Woody
> version of the manual.  The new manual is in the coreutils.info file.

Ah, OK, my mistake!  That sh-utils is a ghost from an earlier
installation.  Sorry.  I do have coreutils.info.

> But this has nothing to do with coreutils and everything to do with
> glibc.

I think it would be helpful if the manual said something like this.  Even
coreutils.info just says (in a fairly buried place) "Normally, `date'
operates in the time zone indicated by `TZ', or the system default if
`TZ' is not set", without giving any indication of exactly how $TZ
indicates.  I found this unhelpful and frustrating.

> > Also, my CMOS clock seems to have gained about half an hour over the
> > last year.  Looking at various scripts in rc[0123456S].d, it seems that
> > Debian Linux overwrites the CMOS clock every time it shuts down.  Damned
> > arrogance that, if you ask me!  I'm confused as to why this is done, and
> > feeling pretty fed up about it.  As a bonus, if anybody can explain to
> > me what's going on here, I'd be very grateful.

> That is normal.  But please ask that question again on
> address@hidden mailing list instead of here.

OK, will do.

> > Also, is there _any_ pertinent documentation of all this stuff anywhere?
> > Any info file or man page that documents TZ, for example?

>   man tzconfig

:-)

> Bob

Thanks again!  My dates are now correct.

-- 
Alan Mackenzie (Ittersbach, Germany).




reply via email to

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