Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clocks and time - clarification please

Status
Not open for further replies.

MonocleMike

Technical User
Oct 25, 2002
41
FR
My understanding of clocks and time in Unix is not complete. I am aware there seem to be three:
1. The BIOS clock time
2. The system time as calculated by Unix from BIOS clock
3. The environment time as adjusted by the TZ settings.
What is the recommended method for ensuring a consistent time on a UK based server with UK based users so that the clocks change with BST, all files are time stamped with current UK time and users get that time displayed in their environment? In the past I have sometimes found I need to adjust the time after a clock change by rebooting and adjusting it on the console at boot time but I'm sure this is unnecessary.
 
Mike, as far as I know, it's just a matter of editing the file /etc/TIMEZONE to include:

 
Oops - premature submission!

Anyway, include the following in /etc/TIMEZONE:

TZ='GMT0BST,M3.5.0/1,M10.5.0/1'
export TZ

This works up here in DScotland anyway!

Cheers.
 
It should all be automatic, if you have it set up correctly.

/etc/TIMEZONE, as you probably know, contains the default settings for the timezone as far as the system is concerned. If this is set correctly, to GMT0BST,M3.5.0/1,M10.5.0/1 for UK, the system will update the time automatically.

The real-time clock change is handled by the following cron job in root's crontab:

[tt]1 3 * * * /etc/setclk -rd1800 > /dev/null 2>&1[/tt]

You should only need to set a user's TZ if it differs from that of the system. Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top