Operations 2 min read

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.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
How to Set Shanghai Timezone on Ubuntu and Keep It Persistent

Set Shanghai Timezone

Use timedatectl to set the system time zone to Asia/Shanghai.

timedatectl set-timezone Asia/Shanghai

Synchronize Time with NTP Server

Synchronize the system clock with Alibaba Cloud's NTP server.

ntpdate ntp1.aliyun.com

Write System Time to BIOS

Save the current system time to the hardware clock so it persists after reboot.

hwclock --systohc

Verify Time Settings

Check the server time format to confirm the changes.

date -R
TimezoneUbuntuhwclockntpdatetimedatectl
Practical DevOps Architecture
Written by

Practical 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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.