How to Set Shanghai Timezone on Ubuntu and Keep It Persistent
This guide shows how to configure Ubuntu to use the Shanghai time zone with timedatectl, synchronize the clock via Alibaba Cloud's NTP server, write the current time to the BIOS using hwclock, and verify the settings with date -R, ensuring accurate time after reboots.
Set Shanghai Timezone
Use timedatectl to set the system time zone to Asia/Shanghai.
timedatectl set-timezone Asia/ShanghaiSynchronize Time with NTP Server
Synchronize the system clock with Alibaba Cloud's NTP server.
ntpdate ntp1.aliyun.comWrite System Time to BIOS
Save the current system time to the hardware clock so it persists after reboot.
hwclock --systohcVerify Time Settings
Check the server time format to confirm the changes.
date -RPractical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
