Thursday, August 13, 2015

Setting of Linux Time

Setting Linux Time

Programs for working with time and date are:

  • clock - This is a soft link to hwclock.
  • date(1) - Print or set the system date and time.
  • hwclock(8) - Sets the hardware clock based on values entered on the command line.
  • setclock(8) - Sets the BIOS hardware clock based on the time and setup of the system clock.
  • timeconfig(8) - A program used to configure the system configuration file "/etc/sysconfig/clock" which includes the type of clock and timezone.

An Example:

While logged in as root do the following:
  1. Type "date".
  2. You should see some variation of"
    "Wed Nov 24, 9:29:17 EST 1999"
  3. To change the time type(as an example):
    date -s 10:10
  4. The system response will be:
    "Wed Nov 24, 10:10:02 EST 1999"
  5. Then if you want to set the hardware(BIOS) clock so the system will keep the time when it reboots type:
    clock -w
    or
    setclock
The program setclock will set your hardware clock based on your system configuration parameters including whether or not your clock is set to universal time.



No comments:

Post a Comment