Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Changing the Time Zone for an ECS

Updated on 2024-10-18 GMT+08:00

Scenarios

The default time zone for an ECS is the one you selected when creating the image that was used to create the ECS. This section describes how to change the time zone for an ECS to the local one or to another time zone in your network.

After you log in to your ECS, if you find that the time on the ECS is different from the local time, you can change the time zone for the ECS so that the time on the ECS is the same as the local time.

For Linux ECSs

The process of changing the time zone for a Linux ECS depends on the OS. In this section, the CentOS 6.x 64bit OS is used to demonstrate how to change the time zone for a Linux ECS.

  1. Log in to the ECS.
  2. Run the following command to switch to user root:

    su - root

  3. Run the following command to obtain the time zones supported by the ECS:

    ls /usr/share/zoneinfo/

    In the terminal display, the /user/share/zoneinfo directory contains a hierarchy of time zone data files. Use the directory structure to obtain your desired time zone file.

    The directory structure shown in /user/share/zoneinfo includes both time zones and directories. The directories contain time zone files for specific cities. Locate the time zone for the city in which the ECS is located.

    For example:
    • If you are to use the time zone for Shanghai, China, run the ls /usr/share/zoneinfo/Asia command to obtain the directory /usr/share/zoneinfo/Asia/Shanghai.
    • If you are to use the time zone for Paris, France, run the ls /usr/share/zoneinfo/Europe command to obtain the directory /usr/share/zoneinfo/Europe/Paris.
  4. Set the target time zone.
    1. Run the following command to open the /etc/sysconfig/clock file:

      vim /etc/sysconfig/clock

    2. Locate the ZONE entry and change its value to the name of the desired time zone file.
      For example:
      • If the target time zone is for Shanghai, China, change the ZONE entry value as follows:

        ZONE="Asia/Shanghai"

      • If the target time zone is for Paris, France, change the ZONE entry value as follows:

        ZONE="Europe/Paris"

  5. Press Esc. Then, run the following command to save and exit the /etc/sysconfig/clock file:

    :wq

  6. Run the following command to check whether the /etc/localtime file is available on the ECS:

    ls /etc/localtime

    • If the file is available, go to step 7.
    • If the file is not available, go to step 8.
  7. Run the following command to delete the existing /etc/localtime file:

    rm /etc/localtime

  8. Run the following command to create a symbolic link between /etc/localtime and your time zone file so that the ECS can find this time zone file when it references the local time:

    ln -sf /usr/share/zoneinfo/Asia/city1 /etc/localtime

  9. Run the following command to restart the ECS so that all services and applications running on the ECS use the new time zone:

    reboot

  10. Log in to the ECS again and run the following command as user root to check whether the time zone has been changed:

    ls -lh /etc/localtime

    The following information is displayed:

    # ls -lh /etc/localtime
    lrwxrwxrwx 1 root root 33 Nov 27 11:01 /etc/localtime -> /usr/share/zoneinfo/Asia/city1

For Windows ECSs

  1. Log in to the ECS.
  2. Click the time display on the far right side of the task bar located at the bottom of your screen. In the dialog box that is displayed, click Change date and time settings.

    The Date and Time page is displayed.

    Figure 1 Date and Time
  3. Click Change time zone.

    The Time Zone Settings page is displayed.

  4. In the Set the time zone pane, choose the target time zone from the Time zone drop-down list.
  5. Click OK.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback