Where are timezones set on most unix systems? - Unix

This is a discussion on Where are timezones set on most unix systems? - Unix ; I'm using a Suse linux system. I was under the impression that changing the TZ variable changes your local session timezone , eg: export TZ=EST All it does however is change the timezone string printed by 'date', it doesn't change ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Where are timezones set on most unix systems?

  1. Where are timezones set on most unix systems?

    I'm using a Suse linux system. I was under the impression that
    changing the TZ variable changes your local session timezone , eg:
    export TZ=EST

    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

  2. Re: Where are timezones set on most unix systems?

    Boltar writes:
    >I'm using a Suse linux system. I was under the impression that
    >changing the TZ variable changes your local session timezone , eg:
    >export TZ=EST


    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.


  3. Re: Where are timezones set on most unix systems?

    On 2008-08-05, Boltar wrote:


    > 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

  4. Re: Where are timezones set on most unix systems?

    On Aug 5, 5:10 pm, Doug McIntyre wrote:
    > 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.


    Yes I know , thats why I said "local session".

    B2003

  5. Re: Where are timezones set on most unix systems?

    On Aug 5, 6:55 pm, Christopher W Aiken wrote:
    > 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.


    Thanks.

    B2003


  6. Re: Where are timezones set on most unix systems?

    2008-08-5, 17:55(+00), Christopher W Aiken:
    > On 2008-08-05, Boltar wrote:

    [...]
    >> saving. How? Can anyone explain how timezones work on unix to me or
    >> point me to some sort of dummies guide link?

    [...]
    > 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.


    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

+ Reply to Thread