All it does however is change the timezone string printed by 'date',
it doesn't change the clock at all. I can do export TZ=EST5 which will
set the clock back (I'm in the UK) but I don't want to have to
manually tell it how many hours behind another zone is. Also if I
unset TZ the system still seems to know I'm in british daylight
saving. How? Can anyone explain how timezones work on unix to me or
point me to some sort of dummies guide link?
Thanks
B2003
Yes, for your process shell that you started. Environmental variables
aren't global. Ie. you can't magicly affect everything else just
because you changed a variable somewhere in some shell.
>All it does however is change the timezone string printed by 'date',
>it doesn't change the clock at all. I can do export TZ=EST5 which will
>set the clock back (I'm in the UK) but I don't want to have to
>manually tell it how many hours behind another zone is. Also if I
>unset TZ the system still seems to know I'm in british daylight
>saving. How? Can anyone explain how timezones work on unix to me or
>point me to some sort of dummies guide link?
It'll affect all processes started after you did it from your shell.
If you need the system set differently (ie. your windowing desktop),
then you need to change that environmental variable before everything
starts up in the process that launches all of that stuff..
You are assuming what you are tweaking makes global changes, and it
really just makes a change locally for you and any processes you
launch out of your shell since you set it.
> saving. How? Can anyone explain how timezones work on unix to me or
> point me to some sort of dummies guide link?
>
> Thanks
>
> B2003
Most/all Linux system have the time zones programmed into
system files. See: /usr/share/zoneinfo/* Just copy your
appropriate "zoneinfo" file to /etc/localtime and your system
will report the time according to the file info from the
"/etc/localtime" file.
--
e-Mail: chris at cwaiken dot net
Home: www.cwaiken.net
Yes I know , thats why I said "local session".
B2003
Thanks.
B2003
It may be a better idea to make it a symlink instead of copying
it. This way, if the files in /usr/share/zoneinfo are updated,
you'll benefit from the update (think of for instance, the
recent change to DST in some parts of the US).
Your system may have an api to configure it. For instance on
debian based systems, you should do:
dpkg-reconfigure tzdata
That will set /etc/localtime and /etc/timezone
--
Stéphane