Prerequisites
Before changing your server timezone, make sure you have:
- SSH access to your VPS (username:
hxroot) - Your server IP address and root password
- Knowledge of your desired timezone (e.g., America/New_York, Europe/London, Asia/Dubai)
Why Timezone Matters
Setting the correct timezone ensures:
- Cron jobs run at the right time
- Log timestamps are accurate
- Applications display correct local time
- Email headers have proper dates
Step 1: Connect to Your VPS
Open your terminal (Mac/Linux) or PuTTY (Windows):
ssh hxroot@YOUR_SERVER_IP -p 22Enter your root password when prompted.
Step 2: Check Current Timezone
View your current timezone and time settings:
timedatectlExample output:
Local time: Mon 2024-01-15 14:30:45 UTC
Universal time: Mon 2024-01-15 14:30:45 UTC
RTC time: Mon 2024-01-15 14:30:45
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: noStep 3: List Available Timezones
See all available timezones:
timedatectl list-timezonesNavigate with arrow keys and press q to quit.
Filter by region (e.g., America):
timedatectl list-timezones | grep AmericaStep 4: Set New Timezone
Use the exact timezone name from step 3:
sudo timedatectl set-timezone America/New_YorkFor other regions:
sudo timedatectl set-timezone Europe/Londonsudo timedatectl set-timezone Asia/Dubaisudo timedatectl set-timezone Australia/SydneyStep 5: Verify the Change
Check that the timezone updated correctly:
timedatectlOr check just the timezone:
timedatectl show --property=Timezone --valueAlso verify the current time:
dateAlternative Method: Using dpkg-reconfigure (Legacy)
For older systems without timedatectl:
sudo dpkg-reconfigure tzdataFollow the interactive menu to select your geographic area and city.
Common Timezones Reference
- USA Eastern: America/New_York
- USA Central: America/Chicago
- USA Mountain: America/Denver
- USA Pacific: America/Los_Angeles
- UK: Europe/London
- Central Europe: Europe/Berlin, Europe/Paris, Europe/Rome
- UAE/Dubai: Asia/Dubai
- India: Asia/Kolkata
- China: Asia/Shanghai
- Japan: Asia/Tokyo
- Australia East: Australia/Sydney
Enable NTP for Automatic Sync (Optional)
Keep your clock accurate automatically:
sudo timedatectl set-ntp yesCheck NTP status:
timedatectl show --property=NTPSynchronized --value💡 Tip: Always use the timedatectl command on modern Ubuntu/Debian systems (16.04+). It's simpler and more reliable than manually symlinking /etc/localtime.
Troubleshooting
Permission denied: Make sure you use sudo when setting timezone.
"Failed to set time zone": Verify the exact timezone name exists using timedatectl list-timezones | grep your_region.
Time still wrong after setting: Check if NTP is enabled: timedatectl status