How to change Date, Time and Time Zone on Linux server

Suppose when  you installed the Linux OS but  forgot to set the proper timezone.  now if you want to change the timezone on your Linux distribution follow the below steps. in my case am using  Red Hat Linux 6,

There are many  methods to change the timezone on your Linux system. One of easy  methods i will show to change the time zone. us can use this method in RHEL, CentOS, SUSE Linux.

 Change TimeZone Using /etc/localtime File

/etc/localtime  keeps the time zone information, For example, if  your current timezone is GMT as shown below and  You would like to change this to SGT follow the below steps.

  1.  check your current timezone using date command

#date

2. /usr/share/zoneinfo this directory contains all the time zone files.

#ls /usr/share/zoneinfo

3. copy your desire timezone file into /etc/localtime to set the timezone

#cp /usr/share/zoneinfo/Singapore /etc/localtime

4.run command date to verify

#date



How to Change Date and Time in Linux command prompt 

IF your Linux server is showing wrong date and time  and you want to change in command prompt, follow the below steps.

  1. run the command date to check the current date and time

  2. to change date and time using date command

#date 060912152017

where:

06  represent month June (MM)

09 - is the date (DD)

12 and 15 is the current hours and minute (12:15) (HH:MM)

2017 is year (YY)

so the format will be #date MMDDHHMMYY 

#date 060912152017

How to change Date, Time and Time Zone on Linux server How to change Date, Time and Time Zone on Linux server Reviewed by TecGeeks News on June 09, 2017 Rating: 5

No comments:

Get Your Business Online Now


Powered by Blogger.