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

Re: Setting local time.



Ken Heard wrote:
On boot I want to have the system clock set to local time -- Eastern Standard Time (EST) in my case. First, I want rdate to be run on daily boot to set the hardware clock, which would consequently always be set to UDC. Second, the system clock on boot would have to be set in local time by reference to the hardware clock, -5 in winter and -4 in summer.

    So, I would apprreciate advice on how to do these three tasks:

1) have rdate run on boot,

2) have the system clock set as described above, and

3) have the system know without prompting when the switch from winter to summer time and vice versa.

As for (1), I found that running rdate -t time.nrc.ca will set the hardware clock to UTC. I would like to have this command run on boot, if I can get (2) and (3) to work.

I tried to implement task (2) as follows. I set in /etc/default/rcS to UTC=YES. I assume that the system will now know that the hardware time is UTC. After reading the commented out lines in hwclock.sh and hwclockfirst.sh and the associated README, in hwclockfirst.sh I set TZ=EST. However, on reboot the system clock is still set to UTC.

As for (3), in my system (sarge with KDE) there is a directory /usr/share/zoneinfo which has a file EST5EDT, which may be relevant. There is also in this file a symbolic link localtime -> /etc/localtime, but the target file (/etc/localtime) does not exist.

I also found a directory /usr/share/configlets/timezoneconf with three files therein: main.glade, main.py and time.xpm. Are these relevant?

    Any and all help will be appreciated.


Why don't you set up your system time via

# base-config

it will ask you some questions and find and set the relevant config files for you.

I use ntpdate to synchronize my clock at boot and ntp to keep it in sync while it is up. The default set-up (without changing any configuration files) of the two packages is to automatically find a suitable time server for you. Of course you could also point the config file manually to your trusted server(s). For typical scenarios this is a 'install and forget' solution.

I'm not 100% shure if this automatically sets summer and winter time, but if you shut off your computer in summer time and reboot it in winter time you're automatically done.

Johannes



Reply to: