مدیریت سرورها

آموزش مدیریت سرورهای لینوکس و ویندوز

مدیریت سرورها

آموزش مدیریت سرورهای لینوکس و ویندوز

سایت در باره انواع آموزشها در زمینه IT می باشد.
مانند: لینوکس، ویندوز، سیسکو، میکروتیک، طراحی وب
به دلیل شخصی بودن وبلاگ ارائه مطالب متفرقه در آن بلامانع است.
با تشکر

طبقه بندی موضوعی

How To: 2 Methods To Change TimeZone in Linux

دوشنبه, ۲۲ دی ۱۳۹۳، ۰۳:۴۹ ب.ظ

Question: When I installed the Linux OS, I forgot to set the proper timezone. How do I change the timezone on my Linux distribution. I use CentOS (Red Hat Linux). But, can you please explain me how to do this on all Linux distributions with some clear examples.

Answer: Use one of the following methods to change the timezone on your Linux system. One of these methods should work for you depending on the Linux distribution you are using.

Method 1: Change TimeZone Using /etc/localtime File

For this example, assume that your current timezone is UTC as shown below. You would like to change this to Pacific Time.

# date
Mon Sep 17 22:59:24 UTC 2010

On some distributions (for example, CentOS), the timezone is controlled by /etc/localtime file.

Delete the current localtime file under /etc/ directory

# cd /etc
# rm localtime

All US timezones are located under under the /usr/share/zoneinfo/US directory as shown below.

# ls /usr/share/zoneinfo/US/
Alaska          Arizona         Eastern         Hawaii          Michigan        Pacific
Aleutian        Central         East-Indiana    Indiana-Starke  Mountain        Samoa

Note: For other country timezones, browse the /usr/share/zoneinfo directory

Link the Pacific file from the above US directory to the /etc/localtime directory as shown below.

# cd /etc
# ln -s /usr/share/zoneinfo/US/Pacific localtime

Now the timezone on your Linux system is changed to US Pacific time as shown below.

# date
Mon Sep 17 23:10:14 PDT 2010

Method 2: Change TimeZone Using /etc/timezone File

On some distributions (for example, Ubuntu), the timezone is controlled by /etc/timezone file.

For example, your current timezone might be US Eastern time (New York) as shown below.


# cat /etc/timezone
America/New_York

To change this to US Pacific time (Los Angeles), modify the /etc/timezone file as shown below.

# vim /etc/timezone
America/Los_Angeles

Also, set the timezone from the command line using the TZ variable.

# export TZ=America/Los_Angeles
منبع: thegeekstuff.com
  • طاهر ضیائی

initial config

نظرات  (۰)

هیچ نظری هنوز ثبت نشده است

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">