HOWTO: Set Clock

From Sabayon Wiki
Revision as of 17:29, 6 January 2014 by Zetok (talk | contribs) (adjust for systemd presence)

Jump to: navigation, search

Setting your Clock

For the whole of this how-to you need to be root user. So you might as well `su` now

With systemd

Look at: HOWTO: systemd#timedatectl

With OpenRC

Please note that OpenRC will be dropped in summer 2014.

Adding NTP to your system

First off we are going to set up so that your computer will go out and find out what time it is on its own.

# equo install net-misc/ntp 

The next two commands will update the time on your system and adjust the time for your hardware clock

# ntpdate
# hwclock --systohc 

Finally we are going to tell your computer that it needs to check the time when it boots up, and keep checking occasionally as long as it is booted up. Also we will set it up so that it will act as a time server for any other devices you might have on your network.

 # rc-update add ntpd default
# rc-update add ntp-client default 

Setting System Time

In our last step we set our hardware clock, now we are going to define our hardware clock. In you favorite text editor, as root, you need to edit:


You should see a line at the bottom of the top section that looks like


If it says anything other than UTC edit it and make it just as that line is in the example. Save and exit.

Setting Local Time

Finally we are going to tell the computer what time zone you are in.

First things first, we remove the link that already exists

 # rm /etc/localtime 

Now we are going to set a link to your actual timezone. The easiest way to drill down to this is using TAB complete, where you type a few letters and hit the tab key to complete the next little bit. If there are too many options it will show you your available options and then you keep typing. A pretty nifty trick.

 # ln -s /usr/share/zoneinfo/USE_TAB_COMPLETE_HERE_TO_SELECT /etc/localtime

an example would be

 ln -s /usr/share/zoneinfo/America/Adak /etc/localtime 

All done and thanks for playing ~Az