Sunday, August 11, 2013

How to set the Time / Date and Timezone in CentOS

Source: http://www.fir3net.com/Redhat-/-Fedora/how-to-set-the-time-date-and-timezone-in-centos.html
In this article we will show you how to set the time, date and timezone within CentOS. Though I'm sure this method will remain the same through the various Linux distributions.

Steps

  1. Set the time zone
  2. Set the time and date
  3. Sync the hwclock with the current time and date

Commands

Below are the commands that are required. For the date command this will set the time and date to 25th July 22:17. The syntax is `date MMDDhhmmYYYY`.
rm /etc/localtime
ln -s /usr/share/zoneinfo/GMT /etc/localtime
date 072522172010
hwclock --systohc

Confirm Settings

To confirm your machine is set with the right time and date run the following commands :
[root@Fileserver ~]# date
Sun Jul 25 22:38:47 GMT 2010
[root@Fileserver ~]# hwclock
Sun 25 Jul 2010 10:38:51 PM GMT  -0.125883 seconds

find . -type d -exec chmod 700 {} \;
find . -type f -exec chmod 400 {} \;

No comments:

Router Packet Networking

Đây là video ngắn khá hay, mô tả đường đi của một gói tin trên Mạng Internet.