SDB:Setting the clock to GMT (Greenwich Mean Time)

Şuraya atla: kullan, ara


Question:

How can I set the computer clock?

Procedure:

  • Advantages:
    • local: no conflicts with other systems at the same machine
    • GMT: automatic settings for summer/wintertime
  • In case of SuSE Linux versions up to 7.3 change the file /etc/rc.config. From SuSE Linux 8.0 on change in /etc/sysconfig/clock the following:
    • local: GMT=""
    • GMT: GMT="-u" Very important is to choose the right timezone, which is for middle europe TIMEZONE=MET.
  • setting the time:

Easily done with the date command e.g. "Thu Jul 10 19:09:00 MEST 1997":

date 071019091997
(Format: MMTTSSMMJJJJ ) or with the ISO-format:
date -s '1997-07-10 19:09:00' +'%Y-%M-%d %T'
more informations with date --help | less or at the info-pages
info date
  • Settings of the CMOS-clock:

The clock command writes and reads the CMOS clock. If you choose GMT for the CMOS clock, you have to set the clock command always with -u. e.g.:

+/kfr $ clock -ur
Thu Jul 10 19:15:10 1997
+/kfr $ clock -r
Thu Jul 10 17:15:11 1997
+/kfr $
reads the appropriate timezone value and changes it to local time. Therefore the value is wrong. With
clock -uw
the CMOS clock receives its settings from the system clock.

Attention: always choose Unix Single User Mode in the settings, in order to avoid problems with programs like make, rcs. Further information in man clock. <keyword>clock,date,timezone,cmos</keyword>