Timezone settings 

Timezone is determined in the following order:

TZ environment variable 

TZ environment variable affects rdate command, but not date command.

change timezone 

help 
$ apropos timezone
tzconfig (1)         - set the local timezone
tzselect (1)         - view timezones
tzselect 

just view it, make some suggestions, doesn't change system setting

tzconfig 

do the changes (menu directed):

/etc/timezone
/etc/localtime
$ file /etc/timezone
/etc/timezone: ASCII text
$ file /etc/localtime
/etc/localtime: timezone data

Use

zdump -v /etc/localtime

to view its content.

cmd:tzconfig 

hardware clock 

Most DOS based PCs set their hardware clock on Local Time, while most UNIX systems set their hardware clock to UTC.

The Debian GNU/Linux system gains its knowledge of this setting from the file /etc/default/rcS. This file contains either the line UTC=yes, which indicates that the hardware clock is set to UTC, or it contains the line UTC=no, which declares the hardware clock is set to Local Time. If these setting are correct, and the hardware clock is truly set as indicated, then configuring the proper timezone for the machine will cause the proper date and time to be displayed. If these are not set correctly, the the reported time will be quite incorrect. See hwclock(8) for more details on this topic.

actual work done 

The work done by tzconfig is actually pretty simple. It just copies the correct timezone installed in /usr/share/zoneinfo/ to /etc/localtime and puts the name of the timezone into /etc/timezone.

There is nothing wrong with doing this manually. However, using tzconfig you don't have to remember the path to the timezones.

manually update timezone 

date; rdate -p rdate
date; hwclock --show
# update timezone, then
# set system's hardware clock
!date
hwclock --systohc
!date

documented on: 2006.09.28

daylight savings time? 

Newsgroups: comp.os.linux.setup
> the "date" command to change the time.  Is there any way to have the
> kernel check for whether it should be using daylight savings time and make
> the adjustment automatically?  Thanks in advance.

It sounds like your system changed the date it maintains, but did NOT change your system's hardware clock. You can use the hwclock utility to do this. For instance:

hwclock --systohc

Alternatively, you can set the hardware clock from your BIOS setup utility the next time you reboot.

Rod Smith

daylight savings time? 

Try setting up a localtime symbolic link - man localtime. This takes the Bios date/time (GMT) and converts it to a local timezone.

daylight savings time? 

If you only use Linux on your computer, tell it you have the hardware clock set to UTC (and set the BIOS clock likewise), and tell it your timezone. If Redhat, use timeconfig. Then all the clocks stick to UTC and convert the timezone dynamically where needed; this works for me.

Robie.

documented on: 2000.06.02

Patch for Daylight Savings Time 

Newsgroups: gmane.linux.debian.user
Date: Tue, 30 Jan 2007 21:56:43 -0700
> Has there been a patch to adjust the start / end date changes for daylight
> savings time in the US?
$ zdump -v /etc/localtime | grep 2007
/etc/localtime  Sun Mar 11 08:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 MST isdst=0 gmtoff=-25200
/etc/localtime  Sun Mar 11 09:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 MDT isdst=1 gmtoff=-21600
/etc/localtime  Sun Nov  4 07:59:59 2007 UTC = Sun Nov  4 01:59:59 2007 MDT isdst=1 gmtoff=-21600
/etc/localtime  Sun Nov  4 08:00:00 2007 UTC = Sun Nov  4 01:00:00 2007 MST isdst=0 gmtoff=-25200

Just take the current "security" updates for libc6.

Rob Sims

Patch for Daylight Savings Time 

> >Just take the current "security" updates for libc6.
> Neat. But this proves that ST setup is ok?

In a slightly different form:

date --date="Mar 10 15:00:00 UTC 2007"
Sat Mar 10 09:00:00 CST 2007
date --date="Mar 11 15:00:00 UTC 2007"
Sun Mar 11 10:00:00 CDT 2007

You see in the output of these date commands that the timezone is listed as CST on March 10 and CDT on March 11, which is correct. You can run the same to commands to determine whether your system also returns the correct timezones on those dates. (Given that I'm running stable and get correct results, I expect that you'll be fine as long as you're up-to-date with whichever branch you're running.)

Dave Sherohman

Time zones 

Eastern Standard Time (EST) = GMT-5 Eastern Daylight Time (EDT) = GMT-4 http://wwp.eastern-standard-time.com/
Pacific Standard Time PST = GMT-8 PDT = GMT-7 (USA & Canada) http://wwp.greenwichmeantime.com/time-zone/usa/pacific-time/

documented on: 2005.07.31

tzconfig for Otario Canada 

Newsgroups:  gmane.linux.debian.user
Date:        Wed, 7 Jul 2004 01:40:49 -0400
> In Debain, I don't know which of the
> following correspond to the Ontario time zone in Canada:
>
> Atlantic Central East-Saskatchewan Eastern Mountain Newfoundland Pacific
> Saskatchewan Yukon

Eastern where I am (Toronto), but I'm not sure where the time zone's western border is.

Seneca

tzconfig for Otario Canada 

> Well, it's easy enough to find;
>
> <http://www.canadainfolink.ca/time.htm>[]
>
> Manitoba is the western border for EDT.

Anywhere West of 90 degrees longitude in Ontario falls in the Central time zone.

Bijan

linux time inaccurate 

Newsgroups: comp.os.linux.setup
>Whenever I reboot the system, my linux server's time will always be
>about 6 hrs ahead of the CMOS(actual) time which I have preset.

It sounds like you have a timezone problem.

  1. Have you properly set up the system clock load (somewhere in your startup scripts; on Slackware it would be in /etc/rc.d/rc.S)? The lines would look likeā€¦

    # Configure the system clock.
    # This can be changed if your system keeps GMT.
    if [ -x /sbin/clock ]; then
      /sbin/clock -s
    fi
  2. Have you properly set up your Timezone settings. You should have an /etc/localtime file (on Slackware, this comes from your timezone setup, and is a file from the files in /usr/lib/zoneinfo)

  3. Have you properly set up your TZ environment variable?

Lew Pitcher