Linux CentOS/Ubuntu/Debian tutorial on modifying and setting the system time zone

888u

Last update at :2024-01-19,Edit by888u

Tilermovers currently supports Linux distributions CentOS, Ubuntu, and Debian. For these three systems, if we want to modify the system time zone, in addition to using the Pagoda panel, we can also modify it through the command line. This article introduces how to modify the system time zone on a Linux system, which is our common Time Zone, because sometimes we may want to change the time zone to Beijing time or other times, and we can modify it ourselves.

When setting the server's time zone, it is best to use the time zone of the majority of users. If you're not sure which time zone is best, consider using Universal Coordinated Time, or UTC, or Greenwich Mean Time. According to tests, the current default time of the Banwagonhost VPS should be Shanghai time zone (Asia/Shanghai). I don’t know how the system sets the default time.

Debian/Ubuntu Set system time zone

Set the system time zone on a Debian or Ubuntu system is very simple, enter the following command line:

dpkg-reconfigure tzdata

After pressing Enter, select the time zone according to the prompts. For example, if you select Asia and Shanghai in sequence, you will see the following output:

$ dpkg-reconfigure tzdata Current default time zone: 'Asia/Shanghai' Local time is now: Wed Sep 22 15:42:31 CST 2021. Universal Time is now: Wed Sep 22 07:42:31 UTC 2021.

Indicates that the time zone has been modified.

CentOS/Arch Linux Set system time zone

On CentOS or Arch Linux, changing the time zone is a little more complicated, but not difficult.

1. View all available system time zones

timedatectl list-timezones

Use the Up, Down, Page Up, and Page Down keys to navigate to the correct time zone. Remember it, write it down or copy it as a mouse selection. Then press q to exit the list.

2. Set the time zone (for example, set America/New_York to the correct time zone)

timedatectl set-timezone 'America/New_York'

The modification is now successful.

How to manually set the Linux system time zone

In addition to the above methods, there are more general methods of setting the system time zone.

Locate the appropriate zone file in the path /usr/share/zoneinfo/ and link the file to /etc/localtime. See the following examples:

Universal Coordinated Time:

ln -sf /usr/share/zoneinfo/UTC /etc/localtime

Eastern Standard Time:

ln -sf /usr/share/zoneinfo/EST /etc/localtime

American Central Time (including daylight saving time) American Central Time:

ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

American Eastern Time (including daylight saving time) American Eastern Time:

ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime

Just link different files according to your needs.

Recommended discounts/cost-effective packages for bricklayers

Warm reminder: If you have difficulty choosing, just choose the CN2 GIA-E plan in the middle. The quarterly payment is $49.99, and you can switch between up to 12 computer rooms at will.

Banwagonhost discount code: BWH3HYATVBJW, discount 6.58%, available everywhere. The table below summarizes more preferential packages for bricklayer removal.

plan Memory CPU harddisk Traffic/month bandwidth engine room price Buy
CN2 (cheapest) 1GB 1 core 20GB 1TB 1Gbps DC3 CN2 DC8 ZNET $49.99/year Buy
CN2 2GB 1 core 40GB 2TB 1Gbps $52.99/half year $99.99/year Buy
CN2 GIA-E (Most recommended) 1GB 2 cores 20GB 1TB 2.5Gbps DC6 CN2 GIA-E DC9 CN2 GIA Japan SoftBank JPOS_1 China Unicom Netherlands EUNL_9 $49.99/quarter $169.99/year Buy
CN2 GIA-E 2GB 3 core 40GB 2TB 2.5Gbps $89.99/quarter $299.99/year Buy
HK 2GB 2 cores 40GB 0.5TB 1Gbps Hong Kong CN2 GIA $89.99/month $899.99/year Buy
HK 4GB 4 core 80GB 1TB 1Gbps $155.99/month $1559.99/year Buy

Select a suggestion:

  • Getting started: Los Angeles CN2 package, currently the cheapest, optional CN2 GT computer room, the entry-level choice.
  • Recommendation: Los Angeles CN2 GIA-E package, affordable, super fast, with many optional computer rooms, and the most cost-effective.
  • High-end: Hong Kong CN2 GIA package, the price is higher, but impeccable.

Recommended site search: multi-IP station group server, domain name registration, US server website, Hong Kong high-defense server, anti-complaint vps host, Japanese proxy server IP, foreign trade space, US server website, virtual host, free PHP space, < /p>

Linux CentOS/Ubuntu/Debian tutorial on modifying and setting the system time zone

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码